+ Reply to Thread
Results 1 to 3 of 3

Adjust formula criteria when cell is blank

  1. #1
    Registered User
    Join Date
    08-19-2010
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2003
    Posts
    8

    Adjust formula criteria when cell is blank

    I am trying to do a count based on multiple criteria and I have three cells (B4,B5,B6) that specify the criteria.

    =SUMPRODUCT((D13:D1937=B5)*(F13:F1937=B4)*(G13:G1937=B6)) works fine if all three cells are filled.

    What I want to have is if one or more of the cells are left blank then the formula will ignore that condition. So if all three cells were blank the formula would count every cell since there is no criteria.

    This might be better suited for a macro, but I am wondering if it is possible in a formula

    Thanks in advance,
    brian
    Last edited by brianmac; 08-20-2010 at 01:17 PM.

  2. #2
    Forum Guru Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,268

    Re: Adjust formula criteria when cell is blank

    Try this formula

    =SUMPRODUCT((SIGN((D13:D19=B5)+(B5="")))*(SIGN((F13:F19=B4)+(B4="")))*(SIGN((G13:G19=B6)+(B6=""))))

  3. #3
    Registered User
    Join Date
    08-19-2010
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Adjust formula criteria when cell is blank

    Amazing! Works perfectly

    I have no idea why it works but am glad it does...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)

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