+ Reply to Thread
Results 1 to 7 of 7

Ignore blank cells when using Index and Match formula

  1. #1
    Registered User
    Join Date
    03-16-2021
    Location
    Germany
    MS-Off Ver
    Office 2016
    Posts
    3

    Ignore blank cells when using Index and Match formula

    Hello,

    I need to read out information from a database using the Index and Match formula combined. In my example data I have 1 criteria giving away the row (company name) and 2 criterias giving away the columb (year and season). This is the formula I am using:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    In rare cases, one company (columb A) is shown two times, with the first entry blank. When the index formula hits such a blank entry, it returns zero. How can I make the Index formula search on until it finds the next entry that matches the criteria which has a value in it?

    There is one limitation: Some entries in the database are asteriks (***) and therefore not numeric. I tried using the SUMPRODUCT formula, which seems to give me what i want, but it only returns #NV in every case because of these non numeric entries.

    See attached my example data.

    Thank you!
    Attached Files Attached Files

  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,728

    Re: Ignore blank cells when using Index and Match formula

    This worked for me in B12:

    =SUMPRODUCT($B$3:$E$7,($A$3:$A$7=A12)*($B$1:$E$1=$B$10)*($B$2:$E$2=$B$11))

    though you might need to use semicolons ( ; ) instead of commas ( , ) in the formula, depending on your regional settings.

    Hope this helps.

    Pete

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

    Re: Ignore blank cells when using Index and Match formula

    Try

    IFERROR($B$3:$E$7+0,0)

    instead of $B$3:$E$7, to avoid error, change it into zero value.

    B12 should be:
    Please Login or Register  to view this content.
    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Quang PT

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

    Re: Ignore blank cells when using Index and Match formula

    Quote Originally Posted by Pete_UK View Post
    =SUMPRODUCT($B$3:$E$7,($A$3:$A$7=A12)*($B$1:$E$1=$B$10)*($B$2:$E$2=$B$11))
    Thanks. It remind me using SUMPRODUCT(XXX,YYY) in this case.

  5. #5
    Registered User
    Join Date
    03-16-2021
    Location
    Germany
    MS-Off Ver
    Office 2016
    Posts
    3

    Re: Ignore blank cells when using Index and Match formula

    Quote Originally Posted by Pete_UK View Post
    =SUMPRODUCT($B$3:$E$7,($A$3:$A$7=A12)*($B$1:$E$1=$B$10)*($B$2:$E$2=$B$11))
    Oh wow, it really does work! Thank you. Is there a way to also retrieve non numeric data like the asteriks (***) with that formula? I tested it and it returns 0 for those. I thought, maybe I can wrap the SUMPRODUCT formula in an IF formula, for example like this (in B12):

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    But in case I have zeros in the database, it would transform these into *** as well. Do you have an idea for that too?

  6. #6
    Registered User
    Join Date
    03-16-2021
    Location
    Germany
    MS-Off Ver
    Office 2016
    Posts
    3

    Re: Ignore blank cells when using Index and Match formula

    Quote Originally Posted by bebo021999 View Post
    B12 should be:
    Please Login or Register  to view this content.
    I will stick to Pete's easier solution, but thanks alot for your effort!

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

    Re: Ignore blank cells when using Index and Match formula

    SUMPRODUCT just returns numeric values (or zero), but *** is a text value, so I don't think you can do it that way. Perhaps if you changed *** to -1 (using Find & Replace), then you could trap it that way.

    Hope this helps.

    Pete

+ 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] Getting array/index formula to ignore blank cells
    By LandSim in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-14-2021, 04:14 PM
  2. Replies: 3
    Last Post: 10-09-2019, 09:04 PM
  3. INDEX MATCH to ignore blank cells in array
    By Leaflock in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-05-2019, 06:36 PM
  4. INDEX MATCH formula, ignore blank cells and define time frames
    By ChildishAlbino in forum Excel General
    Replies: 2
    Last Post: 02-16-2016, 03:16 PM
  5. [SOLVED] INDEX/MATCH formula doesn't like blank cells.
    By Big.Moe in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-07-2015, 01:40 PM
  6. Replies: 0
    Last Post: 11-05-2014, 10:54 AM
  7. [SOLVED] An INDEX MATCH formula has blank cell - need to ignore or delete
    By rls231 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-26-2013, 11:13 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