If formula

kumar0318

New Member
Joined
Mar 25, 2022
Messages
11
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Hello- I have a date column in column A, and I need to build an "IF" formula based on the following conditions:

0- days if its future date
1- If its less than 30 days
2 - if its less than 60 days
3- If its less than 120 days
4- if its more than 120 days
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Less than 30 days from what?
Another date or the current date?
And is that 30, 60, 120 days in the past?
 
Upvote 0
less than the date in the date column. Here is what the date column looks like:
Estimated In-Service-Date (Depreciation starts)
3/31/2023​
10/1/2022​
7/31/2021​
12/31/2021​
3/31/2023​
2/28/2023​
10/30/2022​
9/30/2022​
9/30/2022​
9/30/2022​
9/30/2022​
9/30/2022​
9/30/2022​
5/13/2020​
7/5/2022​
5/31/2022
 
Upvote 0
lets say I'm working on a current month, which is March. Anything after match 31 would be 0. Anything between March ist to March 31st would be 1, Anything from Feb 1 to March 31st is 2
 
Upvote 0
So, are you just comparing the current month to the month of the date (which could be a bit different than going by the number of days)?
If you are doing a date comparison, we need to know exactly what date you want to compare it do:
- the current date (i.e. 3/15)
- the first day of the current month (i.e. 3/1)
- last last day of the current month (i.e. 3/31)

Also, which version of Excel are you trying to do this on? 365 or 2007?
There are some really cool new functions in 365 that might make things easier, but I don't want to suggest them if you aren't using that version.
 
Upvote 0
Can you please answer my other question?
So, are you just comparing the current month to the month of the date (which could be a bit different than going by the number of days)?
If you are doing a date comparison, we need to know exactly what date you want to compare it do:
- the current date (i.e. 3/15)
- the first day of the current month (i.e. 3/1)
- last last day of the current month (i.e. 3/31)
Your answer needs to be one of those three options I listed.
You will get different results based on which one you choose, so it makes a big difference!
 
Upvote 0
- the current date (i.e. 3/15)
- the first day of the current month (i.e. 3/1)
- last last day of the current month (i.e. 3/31)

Yes- that's correct
 
Upvote 0
- the current date (i.e. 3/15)
- the first day of the current month (i.e. 3/1)
- last last day of the current month (i.e. 3/31)

Yes- that's correct
No, its not!
You need to pick just ONE (and EXACTLY one) of those three options!
For this calculation, which date do you want to compare the dates on your sheet to?

Can you please answer that question?
 
Upvote 0

Forum statistics

Threads
1,214,608
Messages
6,120,500
Members
448,968
Latest member
screechyboy79

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top