Choose Column in Calculation

M

martins

I use the following formula to calculate the days between 2 dates –

=if(or(A1="",B1=""),0,B1-A1

How would the formula look if I wanted to add another column say ‘C1’
and then for the result to be calculated according to which cell had
date entry e.g. either B1 or C1 - that would then minus A1
 
G

Guest

Hi,

One possibility:

=IF(A1="",0,IF(AND(B1<>"",C1<>""),"Delete a date (Col B or Col
C)",IF(AND(B1="",C1=""),0,IF(B1="",C1-A1,B1-A1))))

Hope this helps,

Regards,
B. R. Ramachandran
 
B

Bob Phillips

=IF(OR(A1="",AND(B1="",C1="")),0,MAX(B1,C1)-A1)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

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

Top