Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Michael Gillie
 
Posts: n/a
Default How do I stop Excel from treating blank cells as zero?

I'm calculating the difference between two dates, such as

A1 - 1st September
B1 - 10th September

So B1-A1 returns 9, which is great.

But I only enter the dates in column B when a certain visit has been made,
and while the cells in B are blank, Excel treats them as zero (or 1st Januray
1900). So B1-A1 returns -39000 odd.

Is there a way to essentially stop it from calculating the formula until
both cells have a value entered?
  #2   Report Post  
Roger Govier
 
Posts: n/a
Default

Hi Michael
Try
=IF(OR(A1="",B1=""),"",B1-A1)

Regards

Roger Govier


Michael Gillie wrote:
I'm calculating the difference between two dates, such as

A1 - 1st September
B1 - 10th September

So B1-A1 returns 9, which is great.

But I only enter the dates in column B when a certain visit has been made,
and while the cells in B are blank, Excel treats them as zero (or 1st Januray
1900). So B1-A1 returns -39000 odd.

Is there a way to essentially stop it from calculating the formula until
both cells have a value entered?

  #3   Report Post  
Anirudh
 
Posts: n/a
Default

Hi Michael,

Pls try this

=IF(a7=" ",,a7-a7)



"Michael Gillie" wrote:

I'm calculating the difference between two dates, such as

A1 - 1st September
B1 - 10th September

So B1-A1 returns 9, which is great.

But I only enter the dates in column B when a certain visit has been made,
and while the cells in B are blank, Excel treats them as zero (or 1st Januray
1900). So B1-A1 returns -39000 odd.

Is there a way to essentially stop it from calculating the formula until
both cells have a value entered?

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
existing excel file when clicked opens blank excel document snows_24 Excel Discussion (Misc queries) 1 May 21st 05 07:15 PM
how do I get excel to ignore blank cells in formulas rbignami Excel Worksheet Functions 1 May 6th 05 03:18 AM
Blank Cells in Pivot Tables Greg Excel Discussion (Misc queries) 1 March 16th 05 09:23 PM
Non Blank - Blank Cells???? Reggie Excel Discussion (Misc queries) 3 January 12th 05 12:04 AM
In Exel 2000, stop the blank cells (with formulas) from printing. tonyoc Excel Discussion (Misc queries) 1 December 10th 04 12:38 AM


All times are GMT +1. The time now is 04:16 PM.

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

About Us

"It's about Microsoft Excel"