# If statement with Dates

1. ## If statement with Dates

Hello and Thank you for the assistance.

I've read a lot of threads and tried so many things before getting to this point of posting a question. I appreciate any help.

Question:
I have one date that can be in three different columns. Two of the columns could be blank. In A1 I want to find the difference between one of those dates compared to (Today) which will result in a value in days.

Example
A1 = formula

B1 = Blank
C1 = Blank
D1 = July 6, 2013

Formula should check if there is a value in B1, if blank go to the next cell C1, if blank then go to D1. Then it will calculate the difference between D1 date and today's date, and return a value of '4'.

Thanks for the help,
Ktkreeger

2. ## Re: If statement with Dates

ktkreeger, welcome to the forum.

In A1, the following formula will work as you require:

``Please Login or Register  to view this content.``
Make sure your DATE entry is as a date, ie: 06/07/2013 (or 07/06/2013 in your neck of the woods.)

Hope this helps.

3. ## Re: If statement with Dates

Solved. Thanks Brendan!

New to forum so I made sure to give you a star for the reputation. Trying to do step two to marked solve and I'm not sure how to change the title.

Thanks again for the quick help.

4. ## Re: If statement with Dates

=abs(lookup(1e99,b:b)-today())

5. ## Re: If statement with Dates

Glad to help, ktkreeger, and thanks for the rep.

To mark your thread "Solved", above your initial post and to the right, there should be a "Thread Tools" dropdown, which contains "Mark solved". I'm sure you'll figure it out from there!

6. ## Re: If statement with Dates

@ktkreeger, Teethless mama's formula is actually a far more manageable one than the one I provided, as it (appears to) look up the largest/highest value in Column B, and subtracts today's date from it.

@Teethless, am I correct in saying that looking up "1E+99" is looking for the largest value in B:B?

7. ## Re: If statement with Dates

Originally Posted by BB1972
@ktkreeger, Teethless mama's formula is actually a far more manageable one than the one I provided, as it (appears to) look up the largest/highest value in Column B, and subtracts today's date from it.

@Teethless, am I correct in saying that looking up "1E+99" is looking for the largest value in B:B?
Lookup 1E99 is very large number much larger than any "date values" so the formula return the last value in a range.

8. ## Re: If statement with Dates

Good to know - thanks for clarifying, Teethless mama.

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1