Forum Discussion

Steve Lusk's avatar
Steve Lusk
Copper Contributor
Mar 18, 2020

Only show if there is a date in column

I want to only show the $ amount in Column A if there is a date.  Everything I try I get an error.  Here is the formula that I have that is totaling the amount now but the same amount shows all the way down and I do not want it to

 

Can someone help me out?

 

=IF(ISDATE(A3),SUM(D2+B3-C3)," ")  -- this one throws an error so the one below is what I am currently using.

=SUM(D2+B3-C3)

 

Your time will be greatly appreciated.

Steve L

6 Replies

  • Steve Lusk 

    Taking @Subodh's reply a step further, an Excel date is a positive number and so will evaluate as TRUE if used in a logical statement ( 0 is FALSE).  This means that

    = IF( A3, D2+B3-C3, " " )

    will do the same job.  Mind you, I would prefer to read a formula such as

    = IF( date, priorBalance+credit-debit, "-" )

    but that is personal taste.

     

  • Steve Lusk 

    Excel treats dates as real numbers and there is no function called ISDATE in Excel, though VBA contains a function called IsDate().

     

    You may replace your function with the following one to see if that returns the desired output.

     

    =IF(ISNUMBER(A3),D2+B3-C3,"")

Resources