coolkat999

New Member
Joined
Dec 28, 2018
Messages
2
Hi

I need some help writing a formula.

I have a table showing dates of birth for employees. I want to be able to show a "yes" in the table if the employee reaches the minimum age in months under each of the years. So for example, the first employee with a dob of 1/2/1960 should only have Yes showing under the date range 1/1/2021 - 31/12/2021 as they will have met the minimum age requirement of 738 months.

However, I only need the "yes" to show once (ie the earliest possible occasion)

Could someone help me write the formula?


From01/01/201901/01/202001/01/202101/01/202201/01/2023
To31/12/201931/12/202031/12/202131/12/202231/12/2023
Required age (months)736737738739740
DOB01/02/1960 Yes
14/08/1958Yes
09/08/1964

<colgroup><col width="87" style="width: 65pt;"><col width="173" style="width: 130pt;"><col width="87" span="5" style="width: 65pt;"></colgroup><tbody>
</tbody>
Many thanks

Will
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi,

Does this do what you need:


Book1
ABCDEFG
1From1/1/20191/1/20201/1/20211/1/20221/1/2023
2To12/31/201912/31/202012/31/202112/31/202212/31/2023
3Required age (months)736737738739740
4DOB2/1/1960 Yes
58/14/1958Yes
68/9/1964
Sheet432
Cell Formulas
RangeFormula
C4=IF(AND(YEAR(EDATE($B4,C$3))=YEAR(C$2),COUNTIF($B4:B4,"Yes")=0),"Yes","")


Formula copied down and across.
 
Upvote 0
Hi, I would use datedif formula (with 'from' in a1 and considering date difference in row 2 in months)
<b$3,countif($a4:a4,"yes")>
Code:
DATEDIF($A4,B$2,"m")

so in b4:

</b$3,countif($a4:a4,"yes")>
Capture2.jpg
[/URL][/IMG]
 
Last edited:
Upvote 0
many thanks jtakw this works a treat


Hi,

Does this do what you need:

ABCDEFG
1From1/1/20191/1/20201/1/20211/1/20221/1/2023
2To12/31/201912/31/202012/31/202112/31/202212/31/2023
3Required age (months)736737738739740
4DOB2/1/1960Yes
58/14/1958Yes
68/9/1964

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet432

Worksheet Formulas
CellFormula
C4=IF(AND(YEAR(EDATE($B4,C$3))=YEAR(C$2),COUNTIF($B4:B4,"Yes")=0),"Yes","")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



Formula copied down and across.
 
Upvote 0
You're welcome, welcome to the forum.

Realized my formula can be slightly shorter, modified below:


Book1
ABCDEFG
1From1/1/20191/1/20201/1/20211/1/20221/1/2023
2To12/31/201912/31/202012/31/202112/31/202212/31/2023
3Required age (months)736737738739740
4DOB2/1/1960 Yes
58/14/1958Yes
68/9/1964
Sheet432
Cell Formulas
RangeFormula
C4=IF(AND(EDATE($B4,C$3)<=C$2,COUNTIF($B4:B4,"Yes")=0),"Yes","")
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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