#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 244
Default IsDate?

Hi! I have two columns, A and B. Each contains dates. In C I want to see the
number of days between the dates in A and B. This works fine using =days360
(I use swedish xl). But sometimes on of the date fields is empty. then it
gives a very big number. thus i want to check somehow if there really is a
date in col A and B. If there are dates then do the calc, if there are no
dates then dont write anything in c. how can i do this? thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default IsDate?

You can check for either of the cells being blank using this:

=IF(OR(A1="",B1=""),"",B1-A1)

and format the cell as nuber with 0 dp. This doesn't check explicitly
for dates, which are just numbers to Excel.

Hope this helps.

Pete

Arne Hegefors wrote:

Hi! I have two columns, A and B. Each contains dates. In C I want to see the
number of days between the dates in A and B. This works fine using =days360
(I use swedish xl). But sometimes on of the date fields is empty. then it
gives a very big number. thus i want to check somehow if there really is a
date in col A and B. If there are dates then do the calc, if there are no
dates then dont write anything in c. how can i do this? thanks!


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,101
Default IsDate?

Try this

=IF(AND(A1<"", B1<""), B1-A1, "")

Assumes dates are in A1 & B1 drag down if required

"Arne Hegefors" wrote:

Hi! I have two columns, A and B. Each contains dates. In C I want to see the
number of days between the dates in A and B. This works fine using =days360
(I use swedish xl). But sometimes on of the date fields is empty. then it
gives a very big number. thus i want to check somehow if there really is a
date in col A and B. If there are dates then do the calc, if there are no
dates then dont write anything in c. how can i do this? thanks!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default IsDate?

=IF(COUNT(A1:B1)<2,"",B1-A1)


"Arne Hegefors" wrote:

Hi! I have two columns, A and B. Each contains dates. In C I want to see the
number of days between the dates in A and B. This works fine using =days360
(I use swedish xl). But sometimes on of the date fields is empty. then it
gives a very big number. thus i want to check somehow if there really is a
date in col A and B. If there are dates then do the calc, if there are no
dates then dont write anything in c. how can i do this? thanks!

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



All times are GMT +1. The time now is 05:56 AM.

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"