+ Reply to Thread
Results 1 to 10 of 10

struggling with 'lookup value in" MATCH function

  1. #1
    Registered User
    Join Date
    05-13-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    15

    struggling with 'lookup value in" MATCH function

    Hi all,
    I have a bunch of %s representing monthly margins running across the page in a row.
    The column header is the month name
    What I want is to find the first column in which the % drops below a specified figure (referenced from another cell), and return either the column number, or the column header.
    I keep trying to use "<45" (for example) in the Lookup value of MATCH to find the first month where the margin drops below say, 45%, but I can only seem the get MATCH to work with an "exact" lookup value on unit values.
    I can't even match the % exactly (which is being calculated by formula), never mind "less than".
    What am I doing wrong?
    thanks for any help
    GRaeme

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: struggling with 'lookup value in" MATCH function

    Try something like this array formula**:

    =INDEX(A1:E1,MATCH(TRUE,A2:E2<G2,0))

    Where G2 = 45%

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    05-13-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: struggling with 'lookup value in" MATCH function

    Yes, that works. Thanks. I though it would be easy to extrapolate it to more than just a single row (example above is just row 2), whereas I have rows 2 to 7.
    So for each row I want the 'change point'. I'm trying to use the product code (in column A) and still struggling to make it work.
    Product code is in column A, rows 2-7 and the % data is columns C - BV, rows 2-7. The returnable is row 1, as you had it.
    I thought it would be easy to build AND into the array formula, but not so!
    Any further pointer?
    thanks again
    Graeme

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: struggling with 'lookup value in" MATCH function

    Can you post a SMALL sample file and show us what result you expect?

    A SMALL file will have about 20 rows worth of data.

  5. #5
    Registered User
    Join Date
    05-13-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: struggling with 'lookup value in" MATCH function

    Sure; small file attached (I hope!)WidgetMargin.xlsx. I used a small sample input table, and an example of what I am trying to get from the data.
    In the instance of the particular data, the margin declines over time, so finding the first instance of the 'satisfied condition' is satisfactory.

    Although the initial supplied array formula works fine, I was hoping to use something I could apply to the range, and so just by copying to different sized data sets would work all the time.

    Help is much appreciated
    Graeme

    I should add, I'm trying to use this: {=INDEX(C3:R3,AND(A16:A23=10012,MATCH(TRUE,C4:R11<40,0)))}
    and keep getting N/A. I think I'm close, but I can't crack it!
    Last edited by GraemeG; 05-07-2015 at 09:40 PM. Reason: extra info

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: struggling with 'lookup value in" MATCH function

    I'm unable to download the sample file.

    I get the never ending "spinner" and the message: "Waiting for response from excelforum.com...".

    I'll try again later.

  7. #7
    Registered User
    Join Date
    05-13-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: struggling with 'lookup value in" MATCH function

    Thanks Tony. Given how easily you seemed to solve my simple request, I suspect you'll see it easily!
    In the file, I'm aiming to get the same array fomula in all the yellow-shaded cells.

    Although I loaded the file at work, it seems to open at home OK (different machine), so I hope I made the attachment work properly.

    Perhaps I should start experimenting with * instead of AND in my formula.
    I must say, even when I've used array formulas which work perfectly (copied off the net and modified), I look at them and still can't understand why they work...
    cheers,
    GG

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: struggling with 'lookup value in" MATCH function

    Try this...

    First, your sample file is set to manual calculation. Set it to automatic calculation.

    This array formula** entered in C16:

    =INDEX(C$3:R$3,MATCH(TRUE,INDEX(C$4:R$11,MATCH(A16,A$4:A$11,0),0)<40%,0))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down as needed.

  9. #9
    Registered User
    Join Date
    05-13-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: struggling with 'lookup value in" MATCH function

    Woo-hoo! Legend!
    Thanks a bundle. Now I'm going to work through the formula and come to terms with the abilities of MATCH.
    Very happy!
    cheers,
    Graeme

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: struggling with 'lookup value in" MATCH function

    You're welcome. Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Multiple criteria lookup - First match :exact" and second match "Closest"
    By mweichorn in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-16-2013, 12:14 PM
  2. [SOLVED] Variable "sheet-name" and "range-name" wanted in INDEX/MATCH-function
    By Fiebuls in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-01-2012, 04:09 PM
  3. alternative function to match (need "if containing" function, not an exact match)
    By xln00b in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-10-2010, 04:25 AM
  4. Replies: 2
    Last Post: 07-11-2007, 06:35 PM
  5. [SOLVED] Lookup or index match for "contains" rather than exact match -- find/search?
    By Excel@shoenfeltconsulting.com in forum Excel General
    Replies: 2
    Last Post: 07-02-2006, 05:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1