IsDate?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
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
 
Try this

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

Assumes dates are in A1 & B1 drag down if required
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top