+ Reply to Thread
Results 1 to 11 of 11

INDEX MATCH with INDIRECTs

  1. #1
    Registered User
    Join Date
    04-26-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    27

    INDEX MATCH with INDIRECTs

    Hello,

    I've been struggling with getting a complex (to me!) formula working. I have sheets named for each month (SEP, OCT, NOV, etc) Each has the day of the month horizontally, and a series of locations vertically. Every day, I go to the right date and enter some info next to each location, based upon date. I also have a sheet called TODAY:

    Cell A3 has =TODAY()
    Cell C1 has =TEXT(A3,"MMM")
    Cell D1 has =TEXT(A3,"DD")

    My hope is to be able to use the date in A3 to go to the right sheet and the right day, and grab the stuff I typed into the locations cells.

    I have been trying to start easy, by hardcoding the month into it and that works, but I am struggling with getting it to work with an INDIRECT.

    =INDEX(SEP!$B$3:$B$71,MATCH(Today!A5,SEP!$A$3:$A$71,0))

    Any help with this would be most appreciated!

    CP
    Last edited by cpyter; 08-12-2015 at 11:18 AM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: INDEX MATCH with INDIRECTs

    =INDeX(INDIRECT($C$ 1& "!$B$3:$B$71"), MATCH(INDIRECT(A3 & "!A5), INDIRECT(C1 & "!$A$3:$A$71"),0)
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    04-26-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: INDEX MATCH with INDIRECTs

    Hi ChemistB, thank you for the attempt, but I could not get it to work. But with a clearer head and more caffeine, I have gotten a little farther with it. This works:

    =INDEX(INDIRECT(""&$C$2&"!$B$3:$B$71"),MATCH(Today!A5,INDIRECT(""&$C$2&"!$A$3:$A$71"),0))

    But does not yet do what I am hoping.. The next part would be to get it to look at the day, found in cell D1, and use an additional MATCH to get the data. I tried this, but it returns an #N/A:

    =INDEX(INDIRECT(""&$C$2&"!$B$3:$B$71"),MATCH(Today!A5,INDIRECT(""&$C$2&"!$A$3:$A$71"),0),MATCH(Today!D1,SEP!B2:AF2,0))

    I will continue beating my head against the Excel wall, but if someone could possibly show me where I am going wrong, that would rock.

    Thanks!

    EDIT

    Not sure if this makes a difference, but when I go to Cell D1 and change it from =TEXT(A3,"DD") to 11, the #N/A changes to a #REF...
    Last edited by cpyter; 08-11-2015 at 10:39 AM.

  4. #4
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: INDEX MATCH with INDIRECTs

    can you upload an example workbook?
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  5. #5
    Registered User
    Join Date
    04-26-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: INDEX MATCH with INDIRECTs

    Sure, here it is
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: INDEX MATCH with INDIRECTs

    Okay,
    1. Need to change D1 to a number (since the headers in SEP are numbers)

    =TEXT(A3,"DD")+0

    2. In G5, you don't need the single quotes ' since your sheet names never have blanks. So remove them. Also, the original lookup range needs to be $B$3:$AF$71 So G5 becomes

    =INDEX(INDIRECT($C$2&"!$B$3:$AF$71"),MATCH(Today!A5, INDIRECT($C$2&"!$A$3:$A$71"),0),MATCH(Today!D1,SEP!$B$2:$AF$2,0))

    Does that help?

  7. #7
    Registered User
    Join Date
    04-26-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: INDEX MATCH with INDIRECTs

    Thank you kindly, ChemistB! Indeed it works. I got rid of that last reference to the month tab name:

    =INDEX(INDIRECT($C$2&"!$B$3:$AF$71"),MATCH(Today!A6, INDIRECT($C$2&"!$A$3:$A$71"),0),MATCH(Today!D$1,INDIRECT($C$2&"!$B$2:$AF$2"),0))

    And it works correctly

    One last issue I just noticed... When the cell in the month sheets is blank, the cell in the Today tab pulls a zero, rather than an empty. Is there an easy way to fix this?

  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: INDEX MATCH with INDIRECTs

    Quote Originally Posted by cpyter View Post
    =INDEX(INDIRECT($C$2&"!$B$3:$AF$71"),MATCH(Today!A6, INDIRECT($C$2&"!$A$3:$A$71"),0),MATCH(Today!D$1,INDIRECT($C$2&"!$B$2:$AF$2"),0))
    Quoted range references within the INDIRECT function are TEXT strings and as such they will never change. So, there's no need for the dollar signs $:

    =INDEX(INDIRECT($C$2&"!B3:AF71"),MATCH(Today!A6,INDIRECT($C$2&"!A3:A71"),0),MATCH(Today!D$1,INDIRECT($C$2&"!B2:AF2"),0))

    Saves a few keystrokes and makes it a bit easier to read!

    One last issue I just noticed... When the cell in the month sheets is blank, the cell in the Today tab pulls a zero, rather than an empty. Is there an easy way to fix this?
    What type of data does the formula normally return? Is it text? Numbers? Could be both? Something else?

    If it's numbers, is 0 an otherwise valid result?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  9. #9
    Registered User
    Join Date
    04-26-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: INDEX MATCH with INDIRECTs

    The data could be 1, 0 or empty. The empties return as zero though currently.

  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: INDEX MATCH with INDIRECTs

    OK, that means you basically have to repeat the formula...

    =IF(the result of the formula=blank, return a blank, repeat the formula here)

    And that would look like this...

    =IF(INDEX(INDIRECT($C$2&"!B3:AF71"),MATCH(Today!A6,INDIRECT($C$2&"!A3:A71"),0),MATCH(Today!D$1,INDIRECT($C$2&"!B2:AF2"),0))="","",INDEX(INDIRECT($C$2&"!B3:AF71"),MATCH(Today!A6,INDIRECT($C$2&"!A3:A71"),0),MATCH(Today!D$1,INDIRECT($C$2&"!B2:AF2"),0)))

  11. #11
    Registered User
    Join Date
    04-26-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: INDEX MATCH with INDIRECTs

    You guys rock, thank you very much!

+ 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. 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
  2. Replies: 6
    Last Post: 04-30-2014, 02:42 AM
  3. Replies: 6
    Last Post: 11-08-2013, 10:29 PM
  4. Replies: 3
    Last Post: 05-02-2013, 01:31 AM
  5. SUMIFS w/ INDIRECTS?
    By HCBalelo in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-19-2012, 08:51 AM
  6. Retreiving Data using AVERAGE and INDIRECTS?
    By crucial in forum Excel General
    Replies: 8
    Last Post: 04-17-2008, 07:47 AM
  7. Best way to count indirects of indirects
    By vsynowiec in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-20-2008, 06: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