Choose Column in Calculation

  • Thread starter Thread starter martins
  • Start date Start date
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
 
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
 
=IF(OR(A1="",AND(B1="",C1="")),0,MAX(B1,C1)-A1)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Back
Top