Solved How to do an IF statement with multiple dates and criteria

March 10, 2017 at 09:16:23
Specs: Windows 10
So I am trying to create and IF statement that takes into account the submit date and the requested date for PTO wherein if the Requested Date is less than five days it should be flagged and if it's over five days it is good. So for example if the submit date was 03/05/2017 and they requested PTO for 03/08/2017 the formula should flag it. I was wondering if an IF statement would help with that or if I should be using some other formula. I really appreciate all help.

See More: How to do an IF statement with multiple dates and criteria

Report •

#1
March 10, 2017 at 09:59:24
✔ Best Answer
There are few issues with your question.

1 - You mention less than five days and over five days, but you don't say what should happen if the difference equals five days.

2 - What do you mean by "the formula should flag it"? Should the cell that contains the formula say e.g. "Flagged"? Should one of the date cells turn a color? Should a Message Box pop up? Should bells and horns sound along with some flashing lights? ;-)

3 - We don't know how your data is laid out, so all we can do is offer a generic suggestion.

Something like this might work, as long as Excel recognizes the dates in A1 and B1 as dates. Simple math, such as subtraction, can be used with dates. Subtracting 2 dates simply returns the number of days between the entries.

=IF(A1-B1<=5,"Flagged","Good")

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •
Related Solutions


Ask Question