ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   If blank statement (https://www.excelbanter.com/excel-discussion-misc-queries/240810-if-blank-statement.html)

Jim

If blank statement
 
I'm using the IF statement below on my spreadsheet, but cell F2 could
potentially be blank, and I'm having trouble writing that into the statement.
If F2 is blank, I want it to disregard the formula and dislay 0. If it's
not blank, then use the formula.

=IF(C2D2,TEXT(F2-C2,"h:mm"),TEXT(F2-D2,"h:mm"))

Thanks in advance.

joeu2004

If blank statement
 
"Jim" wrote:
If F2 is blank, I want it to disregard the formula and dislay 0.


=if(F2="", 0, TEXT(F2-MAX(C2,D2), "h:mm"))

If you format the cell with custom format h:mm, zero will be displayed as
0:00, if that's what you really want (I would).


----- original message -----

"Jim" wrote in message
...
I'm using the IF statement below on my spreadsheet, but cell F2 could
potentially be blank, and I'm having trouble writing that into the
statement.
If F2 is blank, I want it to disregard the formula and dislay 0. If it's
not blank, then use the formula.

=IF(C2D2,TEXT(F2-C2,"h:mm"),TEXT(F2-D2,"h:mm"))

Thanks in advance.



Max

If blank statement
 
Try COUNT: =IF(COUNT(C2,D2,F2)<3,"",<your expression)
Success? hit YES below
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
---
"Jim" wrote:
I'm using the IF statement below on my spreadsheet, but cell F2 could
potentially be blank, and I'm having trouble writing that into the statement.
If F2 is blank, I want it to disregard the formula and dislay 0. If it's
not blank, then use the formula.

=IF(C2D2,TEXT(F2-C2,"h:mm"),TEXT(F2-D2,"h:mm"))

Thanks in advance.


Max

If blank statement
 
Ah, a simpler way, since you say
If F2 is blank, I want it to disregard the formula and display 0.


=IF(F2="",0,IF(C2D2,TEXT(F2-C2,"h:mm"),TEXT(F2-D2,"h:mm")))
Strap on a front IF to check on F2
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
---

Jim

If blank statement
 
both of these formulas give me the desired results - thanks!

"Jim" wrote:

I'm using the IF statement below on my spreadsheet, but cell F2 could
potentially be blank, and I'm having trouble writing that into the statement.
If F2 is blank, I want it to disregard the formula and dislay 0. If it's
not blank, then use the formula.

=IF(C2D2,TEXT(F2-C2,"h:mm"),TEXT(F2-D2,"h:mm"))

Thanks in advance.



All times are GMT +1. The time now is 03:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com