# Formula to lookup data with IF function

1. ## Formula to lookup data with IF function

Hi,
I am trying to populate a date in column C by doing a lookup of column B and do a simple formula (column B's date - 3 working days) [example: column B's date is 6/1, so result should be 5/27), but if column A has a date, it will take column A date.

However, somehow my formula is not working right.

Need expertise advise what is wrong with the formula.

Thanks!  Register To Reply

2. ## Re: Formula to lookup data with IF function

Try this:

=IF(A2<>"",A2,WORKDAY.INTL(B2,-3))  Register To Reply

3. ## Re: Formula to lookup data with IF function

Thanks, Aligw! It works perfectly now.

One more question:
If column A and B has no date, I want the formula to return with a blank.

I tried this formula but it does not work. Any advise?

=IF(IFNA(N90<>"",N90,WORKDAY.INTL(O90,-3)))

Thanks again.  Register To Reply

4. ## Re: Formula to lookup data with IF function

This:

=IF(AND(A2="",B2="","",A2<>"",A2,WORKDAY.INTL(B2,-3)))  Register To Reply

5. ## Re: Formula to lookup data with IF function

Having the attached error.  Register To Reply

6. ## Re: Formula to lookup data with IF function

Sorry - missing bit!

=IF(AND(A2="",B2=""),"",IF(A2<>"",A2,WORKDAY.INTL(B2,-3)))  Register To Reply

7. ## Re: Formula to lookup data with IF function

Thanks Aligw! Now is perfect   Register To Reply

8. ## Re: Formula to lookup data with IF function

No worries!  Register To Reply