# Excel "If Then" Formula

Solved/Closed
jessica2991 Posts 4 Registration date Thursday July 17, 2014 Status Member Last seen July 30, 2014 - Jul 17, 2014 at 03:50 PM
jessica2991 Posts 4 Registration date Thursday July 17, 2014 Status Member Last seen July 30, 2014 - Jul 30, 2014 at 01:34 PM
I am looking to create a "If Then" formula for Excel that can put an "X" in the cell if the date I am reffering to (Cell A6) is 0-5 days, next cell 6-15 days, next cell 16-30, 31-42 next cell, and in the final cell greater than 42 days. Can anyone help me come up with that formula?
Related:

## 5 responses

Mazzaropi Posts 1985 Registration date Monday August 16, 2010 Status Contributor Last seen May 24, 2023 147
Jul 17, 2014 at 04:01 PM
jessica2991, Good afternoon.

It sounds a little confuse.

Do you want this comparison to wich date?
Do you want one answer for each cell?

jessica2991 Posts 4 Registration date Thursday July 17, 2014 Status Member Last seen July 30, 2014
Jul 21, 2014 at 11:02 AM
I am trying to do an aging chart. So each cell has a given day that it was contracted on, for example A6 has a date, A7 has a date, and so on. I want to set up an aging report to see if today is 0-5 days from that date, if today is 6-15 days from that day, is today is 16-30 days from that date, if today is 31-42 days from that date, and in the final cell if today is greater than 42 days. The layout should look something like this:

0-5 Days 6-15 Days 16-30 Days 31-42 Days >42 Days
X
Mazzaropi Posts 1985 Registration date Monday August 16, 2010 Status Contributor Last seen May 24, 2023 147
Jul 21, 2014 at 12:28 PM
jessica2991, Good afternoon.

I did an example for you.
http://speedy.sh/yrJdZ/21-07-2014-en-kioskea-Contract-Aging-Calculus-OK.xlsx

Is it what you want?
I hope it helps.
--
Belo Horizonte, Brasil.
Marcílio Lobão
jessica2991 Posts 4 Registration date Thursday July 17, 2014 Status Member Last seen July 30, 2014
Jul 28, 2014 at 11:18 AM
I am not able to open that file. Is there any way you can write the formula out? Thank you for your help!
Mazzaropi Posts 1985 Registration date Monday August 16, 2010 Status Contributor Last seen May 24, 2023 147
Jul 28, 2014 at 12:49 PM
jessica2991, Good afternoon.

I checked the link and it's OK!

A screenshot of the file:

C3 --> =IF(DATEDIF(B3,TODAY(),"d")<=5,"x","")
D3 --> =IF(AND(DATEDIF(B3,TODAY(),"d")>=6,DATEDIF(B3,TODAY(),"d")<=15),"x","")
E3 --> =IF(AND(DATEDIF(B3,TODAY(),"d")>=16,DATEDIF(B3,TODAY(),"d")<=30),"x","")
F3 --> =IF(AND(DATEDIF(B3,TODAY(),"d")>=31,DATEDIF(B3,TODAY(),"d")<=42),"x","")
G3 --> =IF(DATEDIF(B3,TODAY(),"d")>42,"x","")
Copy them down

C13 --> =CONT.SE(C3:C12;"X")

I hope it helps.
--
Belo Horizonte, Brasil.
Marcílio Lobão

Didn't find the answer you are looking for?