+ Reply to Thread
Results 1 to 8 of 8

Index match duplicate values, need to ignore zeros or blanks in range

  1. #1
    Registered User
    Join Date
    05-22-2020
    Location
    Leningrad
    MS-Off Ver
    2007
    Posts
    34

    Index match duplicate values, need to ignore zeros or blanks in range

    Hi everyone,

    I'm using the below formula to return 2 pieces of data. The data is a range of numbers from 0 to 4 inclusive. I am using this formula to return the title of the largest and second largest value without duplication.

    =INDEX($b2:$g2,MATCH(LARGE($b2:$g2-COLUMN($b2:$g2)/10\^10,COLUMNS($b6:b6)),$b2:$g2-COLUMN($b2:$g2)/10\^10,0))

    However - I have a problem. I need the formula to incorporate an additional function - I need the formula to fetch values greater than 0 only. i.e. 1-4 inclusive

    How could I incorporate either greater than 0 into the formula - or could we incorporate ignore blank cells into the formula and I can adjust the data to only return values greater than 0?

    Attachment enclosed.

    Thanks!
    Attached Files Attached Files
    Last edited by LordByron; 05-24-2020 at 12:13 PM. Reason: Added attachment

  2. #2
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    Germany
    MS-Off Ver
    365
    Posts
    490

    Re: Index match duplicate values, need to ignore zeros or blanks in range

    Your formula is not even valid: /10\^10 is not a valid expression that is recognised, at least in my Excel.

    See attached if that is what you have in mind.

    Also, what happens if all values are 0 or all values are 4?

    Regards
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-22-2020
    Location
    Leningrad
    MS-Off Ver
    2007
    Posts
    34

    Re: Index match duplicate values, need to ignore zeros or blanks in range

    Quote Originally Posted by RaulSerg View Post
    Your formula is not even valid: /10\^10 is not a valid expression that is recognised, at least in my Excel.

    See attached if that is what you have in mind.

    Also, what happens if all values are 0 or all values are 4?

    Regards
    Hi Raul,

    Thanks for the reply. It seems to work fine with me, as an array formula. I have enclosed an attachement to my original post for clarification.

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Index match duplicate values, need to ignore zeros or blanks in range

    I change the date (with VBA code) from row into column (see sheet Oeldere).

    After that a pivot table.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Index match duplicate values, need to ignore zeros or blanks in range

    Please try at J7

    =IFERROR(INDEX($A$4:$H$4,MOD(SMALL(IF(B7:H7,COLUMN(B7:H7)-B7:H7*10^9),COLUMNS($J7:J7)),10^9)),"")

    Confirm by Ctrl+Shift+Enter
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-22-2020
    Location
    Leningrad
    MS-Off Ver
    2007
    Posts
    34

    Re: Index match duplicate values, need to ignore zeros or blanks in range

    Quote Originally Posted by Bo_Ry View Post
    Please try at J7

    =IFERROR(INDEX($A$4:$H$4,MOD(SMALL(IF(B7:H7,COLUMN(B7:H7)-B7:H7*10^9),COLUMNS($J7:J7)),10^9)),"")

    Confirm by Ctrl+Shift+Enter
    Definatly getting there! Thank you, so far! In the real sheet, I have the scores in cells HM800 to ID800, with the titles in HM4 to ID4 and the top 2 team results in IE800 and IF800 - when i plug the formula in on the real sheet, its blank - what changes am I required to make?

    Thank you so far!

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Index match duplicate values, need to ignore zeros or blanks in range

    Please try at
    IE800
    =IFERROR(INDEX($HM$4:$ID$4,MOD(SMALL(IF($HM800:$ID800,COLUMN($HM$4:$ID$4)-$HM800:$ID800*10^9),COLUMNS($IE$4:IE$4)),10^9)-COLUMN($HM$4)+1),"")

    or

    =IFERROR(INDEX($A$4:$ID$4,MOD(SMALL(IF($HM800:$ID800,COLUMN($HM$4:$ID$4)-$HM800:$ID800*10^9),COLUMNS($IE$4:IE$4)),10^9)),"")

  8. #8
    Registered User
    Join Date
    05-22-2020
    Location
    Leningrad
    MS-Off Ver
    2007
    Posts
    34

    Re: Index match duplicate values, need to ignore zeros or blanks in range

    Quote Originally Posted by Bo_Ry View Post
    Please try at
    IE800
    =IFERROR(INDEX($HM$4:$ID$4,MOD(SMALL(IF($HM800:$ID800,COLUMN($HM$4:$ID$4)-$HM800:$ID800*10^9),COLUMNS($IE$4:IE$4)),10^9)-COLUMN($HM$4)+1),"")

    or

    =IFERROR(INDEX($A$4:$ID$4,MOD(SMALL(IF($HM800:$ID800,COLUMN($HM$4:$ID$4)-$HM800:$ID800*10^9),COLUMNS($IE$4:IE$4)),10^9)),"")
    Friend, you are a legend! Thank you so much! It is much appreciated!

+ 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 Duplicate Values - ignore cells equal to 0
    By LordByron in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-23-2020, 11:49 AM
  2. Help needed! INDEX/MATCH, Ignore Blanks in an array
    By JavierEM in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-31-2019, 10:05 PM
  3. INDEX/MATCH/TRIM: Blanks instead of Zeros
    By Morey in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-08-2019, 02:03 PM
  4. [SOLVED] Ignore blanks in Index/Match
    By dazbear in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-25-2018, 03:55 PM
  5. Index/Match ignoring Blanks/Zeros for each instance
    By corhrtz in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-18-2015, 11:04 AM
  6. How to ignore blanks in an Index/Match Array Formula
    By michaelcarrera in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-06-2015, 08:50 PM
  7. Replies: 2
    Last Post: 03-25-2014, 05:37 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