+ Reply to Thread
Results 1 to 16 of 16

Nested Index/Match/Match problems

  1. #1
    Registered User
    Join Date
    07-03-2018
    Location
    Vancouver
    MS-Off Ver
    2018
    Posts
    7

    Nested Index/Match/Match problems

    I am trying to write a formula where if there is no information in the first column, then look to the next column to see if there is anything there, if something is found then execute the formula. I have managed to get it working for two columns, however not sure if that is the limitations with the formula I'm using. I'm using Index/Match/Match to lookup from the table below. So if there is nothing in L, then move on to N etc. I started in U and have managed to get U and V working, however can't get any more.

    Capture.PNG

    It's quite a complex spreadsheet, however what it's saying is that if there is a yes (or y) in columns I or J, then start looking at column U and match the amount . If that combination is found in the table on the next sheet, bring back the amount and multiply it by figures I have in columns E & X. If no data in column U then move on to column V.

    This is the lookup table in Sheet 2:
    Capture2.PNG

    ...and the formula I have so far:

    =IFERROR(IF(OR(I11="y",J11="y"),INDEX('Sheet2'!C42:N56,MATCH(U11,'Sheet2'!B42:B56,0),MATCH('Sheet1'!U2,'Sheet2'!C41:N41,0))*E11*X11,IF(AND(I11="n",J11="n"),INDEX('Sheet2'!C23:N37,MATCH(U11,'Sheet2'!B23:B37,0),MATCH('Sheet1'!U2,'Sheet2'!C22:N22,0))*E11*X11)),IF(OR(I11="y",J11="y"),INDEX('Sheet2'!C42:N56,MATCH(V11,'Sheet2'!B42:B56,0),MATCH('Sheet1'!V2,'Sheet2'!C41:N41,0))*E11*X11,IF(AND(I11="n",J11="n"),INDEX('Sheet2'!C23:N37,MATCH(V11,'Sheet2'!B23:B37,0),MATCH('Sheet1'!V2,'Sheet2'!C22:N22,0))*E11*X11)))

    Apologies if this does not make any sense whatsoever, however any help would be appreciated.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: Nested Index/Match/Match problems

    As this is your first post, welcome to the forum (although you seemed to have joined last year).

    It would help if you attached a sample Excel workbook, rather than pictures of one (which can't be edited).

    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and then on Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post. Do not try to use the Paperclip icon, as it doesn't work on this forum.

    Hope this helps.

    Pete

    P.S. Being several hours ahead of you, I'll be going to bed soon, so someone else might chip in while I'm asleep.

  3. #3
    Registered User
    Join Date
    07-03-2018
    Location
    Vancouver
    MS-Off Ver
    2018
    Posts
    7

    Re: Nested Index/Match/Match problems

    Apologies, please find attached dummy file. Thanks Pete.
    Attached Files Attached Files
    Last edited by V1T; 04-10-2019 at 08:19 PM. Reason: Changing file

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: Nested Index/Match/Match problems

    I can't see the attachment - did you remember to click on Upload?

    Pete

  5. #5
    Registered User
    Join Date
    07-03-2018
    Location
    Vancouver
    MS-Off Ver
    2018
    Posts
    7

    Re: Nested Index/Match/Match problems

    Sorry I had to edit the file - try now.

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: Nested Index/Match/Match problems

    Yes, I can download it now, but at 1:40 am, it really is time for me to go to bed.

    Pete

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Nested Index/Match/Match problems

    I am trying to write a formula where if there is no information in the first column, then look to the next column to see if there is anything there, if something is found then execute the formula. I have managed to get it working for two columns, however not sure if that is the limitations with the formula I'm using.
    This will remedy that part. Embed it in your formula where needed and you will not have to check each column separately. Try 'demoing' it in Z3 and fill down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Then try in AA3
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    That will return the first number. Then this in AB3
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    That will return the 'L#.#' headers.

    I haven't examined the rest of your formula thoroughly. I couldn't help noticing the relative cell/range references. It appears you are hand typing each formula in each row. You can save yourself a lot of grief and work if you get acquainted with relative/absolute cell referencing. (That's what the $ signs are about.)

    With that thought in mind I encourage you to read up here: Relative and Absolute Cell References

    Does any of this help?
    Last edited by FlameRetired; 04-10-2019 at 10:01 PM.
    Dave

  8. #8
    Registered User
    Join Date
    07-03-2018
    Location
    Vancouver
    MS-Off Ver
    2018
    Posts
    7

    Re: Nested Index/Match/Match problems

    Thanks FlameRetired, I'll give that a go. I do know about relative/absolute cell referencing - just trying to get the formula right to start with.

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Nested Index/Match/Match problems

    Good deal!

  10. #10
    Registered User
    Join Date
    07-03-2018
    Location
    Vancouver
    MS-Off Ver
    2018
    Posts
    7

    Re: Nested Index/Match/Match problems

    Everything I've tried so far doesn't work unfortunately.

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Nested Index/Match/Match problems

    "doesn't work" is not helpful information.

    Please be more specific.

  12. #12
    Registered User
    Join Date
    07-03-2018
    Location
    Vancouver
    MS-Off Ver
    2018
    Posts
    7

    Re: Nested Index/Match/Match problems

    Apologies, I've tried inserting the isnumber formula into my existing formula and only get a #NA or #Value in return. I'm obviously not adding it in correctly, as everything I try fails.

  13. #13
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Nested Index/Match/Match problems

    Try this in Y3 and fill down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    It returns this at my end.


    Y
    2
    Wages
    3
    1,309.50
    4
    1,047.60
    5
    1,047.60
    6
    1,204.74
    7
    -
    8
    -
    9
    -
    10
    -
    11
    1,673.25
    12
    1,338.60
    13
    -
    14
    -
    15
    -
    16
    -
    17
    -
    18
    -
    19
    -
    20
    -
    21
    -
    22
    -
    23
    -
    24
    -
    25
    -

  14. #14
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Nested Index/Match/Match problems

    1 - Using MAX to get the number in row 11 (Assuming there is only one figure in L:V):
    MAX($L11:$V11)
    2 - Using LOOKUP to get row title:
    LOOKUP(MAX($L11:$V11),$L11:$V11,$L$2:$V$2)
    3 - We use the range B22:M37 only, penalty range will be B22:B37*1.15
    Using if statement:
    IF(I11&J11="NN",1,1.15)
    4- Using VLOOKUP (or INDEX(MATCH...)
    VLOOKUP(MAX($L11:$V11),Sheet2!$B$22:$M$37,MATCH(LOOKUP(MAX($L11:$V11),$L11:$V11,$L$2:$V$2),Sheet2!$B$22:$M$22,0),0)*E11*X11*(IF(I11&J11="NN",1,1.15))
    5- Error trap:

    Please Login or Register  to view this content.
    Quang PT

  15. #15
    Registered User
    Join Date
    07-03-2018
    Location
    Vancouver
    MS-Off Ver
    2018
    Posts
    7

    Re: Nested Index/Match/Match problems

    You're both stars - both work perfectly, thank you

  16. #16
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Nested Index/Match/Match problems

    You are welcome. Glad to help.

+ 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. Nested If, Index, Match, Match
    By Dominic.Brice in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-05-2018, 07:51 AM
  2. [SOLVED] Problems with INDEX, MATCH, MATCH returning incorrect values
    By Paul103 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-03-2018, 05:16 PM
  3. Problems applying INDEX-MATCH-MATCH function on other data
    By LennartB in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-13-2015, 05:33 AM
  4. INDEX MATCH MATCH/OFFSET MATCH MATCH with named ranges
    By Andrew-Mark in forum Excel General
    Replies: 3
    Last Post: 02-27-2015, 10:56 PM
  5. Replies: 6
    Last Post: 04-30-2014, 02:42 AM
  6. Replies: 10
    Last Post: 12-18-2012, 07:59 AM
  7. Nested Match(index()) vs. Match() array formula.
    By GeneralDisarray in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-14-2011, 07:57 AM

Tags for this Thread

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