ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Formula to show 2 months within 3rd birthday (https://www.excelbanter.com/excel-discussion-misc-queries/241859-formula-show-2-months-within-3rd-birthday.html)

Mally

Formula to show 2 months within 3rd birthday
 
Hi.

In cell A1 I have a date of birth.

In cell B1 I want to display a cell colour of red if todays date is within 2
months of the 3rd birthday.

I'm going to copy this formula down.

Thanks in advance for any help.



David Biddulph[_2_]

Formula to show 2 months within 3rd birthday
 
CF/ Formula Is:
=AND(DATE(YEAR(A1)+3,MONTH(A1)-2,DAY(A1))<TODAY(),DATE(YEAR(A1)+3,MONTH(A1)+2,DAY (A1))TODAY())
You may want to change < to <= and to =, depending on whether you want
the limits to be inclusive or exclusive.
And you may also wish to change the formula if you only want to cover dates
within 2 months BEFORE the 3rd birthday and to exclude dates AFTER the 3rd
birthday.
--
David Biddulph

"Mally" wrote in message
...
Hi.

In cell A1 I have a date of birth.

In cell B1 I want to display a cell colour of red if todays date is within
2
months of the 3rd birthday.

I'm going to copy this formula down.

Thanks in advance for any help.





Jacob Skaria

Formula to show 2 months within 3rd birthday
 
1. Select the cell/Range Column B (B1 is the active cell)
2. From menu FormatConditional Formatting
3. For Condition1Select 'Formula Is' and enter the below formula

=AND(DATE(YEAR(A1)+3,MONTH(A1),DAY(A1))<=TODAY(),D ATE(YEAR(A1)+3,MONTH(A1),DAY(A1))DATE(YEAR(TODAY( )),MONTH(TODAY())-2,DAY(TODAY())))

4. Click Format ButtonPattern and select your color (say Red)
5. Hit OK

If this post helps click Yes
---------------
Jacob Skaria


"Mally" wrote:

Hi.

In cell A1 I have a date of birth.

In cell B1 I want to display a cell colour of red if todays date is within 2
months of the 3rd birthday.

I'm going to copy this formula down.

Thanks in advance for any help.



Mally

Formula to show 2 months within 3rd birthday
 
Hi David

Thanks for your help. This worked ok.

"David Biddulph" wrote:

CF/ Formula Is:
=AND(DATE(YEAR(A1)+3,MONTH(A1)-2,DAY(A1))<TODAY(),DATE(YEAR(A1)+3,MONTH(A1)+2,DAY (A1))TODAY())
You may want to change < to <= and to =, depending on whether you want
the limits to be inclusive or exclusive.
And you may also wish to change the formula if you only want to cover dates
within 2 months BEFORE the 3rd birthday and to exclude dates AFTER the 3rd
birthday.
--
David Biddulph

"Mally" wrote in message
...
Hi.

In cell A1 I have a date of birth.

In cell B1 I want to display a cell colour of red if todays date is within
2
months of the 3rd birthday.

I'm going to copy this formula down.

Thanks in advance for any help.






Mally

Formula to show 2 months within 3rd birthday
 
Hi Jacob

I tried your formula but it didn't work. Maybe i was doing something
incorrect. Anyway David's post above worked so thank you for your help.

"Jacob Skaria" wrote:

1. Select the cell/Range Column B (B1 is the active cell)
2. From menu FormatConditional Formatting
3. For Condition1Select 'Formula Is' and enter the below formula

=AND(DATE(YEAR(A1)+3,MONTH(A1),DAY(A1))<=TODAY(),D ATE(YEAR(A1)+3,MONTH(A1),DAY(A1))DATE(YEAR(TODAY( )),MONTH(TODAY())-2,DAY(TODAY())))

4. Click Format ButtonPattern and select your color (say Red)
5. Hit OK

If this post helps click Yes
---------------
Jacob Skaria


"Mally" wrote:

Hi.

In cell A1 I have a date of birth.

In cell B1 I want to display a cell colour of red if todays date is within 2
months of the 3rd birthday.

I'm going to copy this formula down.

Thanks in advance for any help.




All times are GMT +1. The time now is 07:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com