+ Reply to Thread
Results 1 to 6 of 6

Min If Dates - Ignore Blanks/Zeroes - No Array Formula??

  1. #1
    Registered User
    Join Date
    07-31-2012
    Location
    Midwest
    MS-Off Ver
    Excel 2007
    Posts
    31

    Min If Dates - Ignore Blanks/Zeroes - No Array Formula??

    Hello -

    I have the following formula:

    Please Login or Register  to view this content.
    Where I'm looking to have a value in cell C2 and pull the earliest date from column B where there may be multiple instances of the value in C2 in column A. However, there are some blanks and some non-blanks in column B as it relates to the value in C2. So, of course, the MIN is pulling in the blanks as 0 and thus giving me the earliest date of 1/0/1900.

    I have thousands of lines of data and need to stay away from array formulas as the calculations kill it. Any suggestion on how to update the formula to accomplish what I'm looking for? Or - is there another formula that you can suggest that works with dates? I've searched and have come up with several MIN IF formulas, but most of them appear to handle numbers...

    Thanks in advance for any assistance anyone is able to provide! It's very much appreciated.

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,176

    Re: Min If Dates - Ignore Blanks/Zeroes - No Array Formula??

    Try:

    =SMALL(INDEX((C2=A2:A5)*B2:B5,),COUNTIF(A2:A5,"<>"&C2)+1)

  3. #3
    Registered User
    Join Date
    07-31-2012
    Location
    Midwest
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Min If Dates - Ignore Blanks/Zeroes - No Array Formula??

    Hi Phuocam,

    That worked for one of my workbooks. It appears if the data is on the same worksheet the formula works well. But if the "lookup" value (the value in C2) and the formula itself aren't in the same worksheet as the data being looked up against it doesn't work.

    When I use the below formula I get the result of: 0

    Please Login or Register  to view this content.
    Is there a active sheet limitation to the SMALL formula only working where the actual data resides?

    Thanks so much!

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,176

    Re: Min If Dates - Ignore Blanks/Zeroes - No Array Formula??

    Try:

    1.

    =SMALL(INDEX((C2='Data Sheet'!A2:A50000)*'Data Sheet'!B2:B50000,),COUNTIF('Data Sheet'!A2:A50000,"<>"&C2)+1+
    COUNTIFS('Data Sheet'!A2:A50000,C2,'Data Sheet'!B2:B50000,""))


    2.

    =SMALL(INDEX((C2='Data Sheet'!A2:A50000)*'Data Sheet'!B2:B50000,),COUNTIF('Data Sheet'!A2:A50000,"<>"&C2)+1+
    SUM(COUNTIFS('Data Sheet'!A2:A50000,C2,'Data Sheet'!B2:B50000,{"",0})))

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Min If Dates - Ignore Blanks/Zeroes - No Array Formula??

    I suggest a helper column.
    Say D2 put
    =IF(A2=C$2,B2,"")
    Fill down to D50000

    Then just use
    =MIN(D2:D50000)

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Min If Dates - Ignore Blanks/Zeroes - No Array Formula??

    Aside from that, it's not merely the existence of an array formula that makes a formula slow.
    It's what the formula actually does that makes it slow.

    I haven't tested, but I would venture this array formula is no less efficient than the original formula you posted
    That original formula is an array formula BTW, it's just some clever use of other functions that make it not require CSE entry.

    =MIN(IF(A2:A50000=C2,IF(B2:B50000>0,B2:B50000,"")))

+ 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. Formula needs to show both blanks and zeroes.
    By austin2 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-04-2015, 10:10 AM
  2. 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
  3. [SOLVED] array formula count "number of" - can it ignore blanks
    By nigelog in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-24-2014, 09:33 AM
  4. [SOLVED] A simple (I hope!) ARRAY question regarding blanks versus zeroes
    By DaddyMac in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-15-2013, 11:45 AM
  5. Automatic sort, ignore zeroes, blanks and combobox
    By jigneshoctober in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 03-17-2011, 11:16 PM
  6. Replies: 3
    Last Post: 09-17-2010, 05:59 AM
  7. Median as an Array does not ignore blanks
    By ctbrian in forum Excel General
    Replies: 8
    Last Post: 05-06-2010, 03:12 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