Consulting

Results 1 to 4 of 4

Thread: Solved: If formula result is Zero then Blank

  1. #1
    VBAX Mentor
    Joined
    Jan 2009
    Posts
    304
    Location

    Solved: If formula result is Zero then Blank

    I have the following formula, which works fine, but is it possible to modify it so that if the result of the formula is equal to 0 (zero) then enter a Blank in the cell?

    =IF($B10="","",SUMPRODUCT((TEXT(WEEKDAY(Timecard!$A$4:$A$53),"ddd")=D$9)*(T imecard!$D$4:$D$53=$B10)*(Timecard!$C$4:$C$53)))

    Because I'm using the first condition to determine if the formula should even be executed ($B10="",""), I'm not sure how to make a resulting 0 a Blank.

    Thanks for any and all help...

    Jim

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    You can nest another If statement
    =IF(A1="","",IF(B1*C1=0,"",B1*C1))
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    =IF(OR($B10="",SUMPRODUCT((TEXT(WEEKDAY(Timecard!$A$4:$A$53),"ddd")=D$9)*(T imecard!$D$4:$D$53=$B10)*(Timecard!$C$4:$C$53))=0),"",SUMPRODUCT((TEXT(WEEK DAY(Timecard!$A$4:$A$53),"ddd")=D$9)*(T imecard!$D$4:$D$53=$B10)*(Timecard!$C$4:$C$53)))

    or better put the calc in another cell and use

    =IF(OR($B10="",C10=0),"",C10)
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  4. #4
    VBAX Mentor
    Joined
    Jan 2009
    Posts
    304
    Location
    Thanks...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •