Nested If's for Date Range

ExcelPoor

New Member
Joined
Dec 9, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi, can someone please help me combine this formula. I'm no good at nested IF functions.
I currently have two columns as below and hence have to create two pivot tables. I'm hoping to combine them into one column, so the pivot data captures both of these scenarios.
=IF(K2 < TODAY()-300,"Yes","No")
=IF(K2 < TODAY()-365,"Yes","No")

Basically, what I need is if the date is greater than 10 months, return '10 months', and if the date is greater than 12 months, return '12 months'.
Thank you :)
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
If your date in K2 is 12/9/24 should that return 12 or 10?

If 12, perhaps:
=TEXT(XLOOKUP(DATEDIF(K2,TODAY(),"m"),{12,10,0},{12,10,0},,-1),"0 ""months"";;")
 
Upvote 0

Forum statistics

Threads
1,224,550
Messages
6,179,459
Members
452,915
Latest member
hannnahheileen

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