#1   Report Post  
Posted to microsoft.public.excel.misc
Jim Jim is offline
external usenet poster
 
Posts: 615
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,059
Default 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.


  #3   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default 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.

  #4   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default 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
---
  #5   Report Post  
Posted to microsoft.public.excel.misc
Jim Jim is offline
external usenet poster
 
Posts: 615
Default 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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
returning blank cell in an if statement Jeremy Excel Worksheet Functions 2 March 18th 09 06:06 PM
if statement when cell is blank davisk Excel Worksheet Functions 6 August 10th 08 12:03 AM
add blank row in an if statement BBoyd Excel Discussion (Misc queries) 3 May 21st 08 11:02 PM
keep cell blank when false in IF statement ruthslaughter Excel Discussion (Misc queries) 2 November 22nd 05 06:15 PM
IF statement when formula result is blank Bonnie Excel Worksheet Functions 2 September 1st 05 05:08 PM


All times are GMT +1. The time now is 10:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"