Count number of cells under a certain period of time in y m d format

sbafw

New Member
Joined
Sep 29, 2020
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello, I'm looking to count the number of times a value is under a certain period of time (in this case, two years). The tricky part for me is that I'm trying to count cells populated with a "#y #m #d" format from a DATEDIF formula.

Example below:

chrome_sy74sBmWRw.png


DATEDIF formula used in B2 and copied down:
Excel Formula:
=DATEDIF(A2,TODAY(),"y") & "y " & DATEDIF(A2,TODAY(),"ym")&"m " & DATEDIF(A2,TODAY(),"md") & "d"

Trying to get C2 to show "2" in this example, but I don't know how to do it with the "#y #m #d" format in column B. Any help would be appreciated.
 

Some videos you may like

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

AlanY

Well-known Member
Joined
Oct 30, 2014
Messages
4,243
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
why don't you count Col A instead?
 

Watch MrExcel Video

Forum statistics

Threads
1,127,422
Messages
5,624,697
Members
416,042
Latest member
Oden

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
Top