Conditional format with EOMONTH function

maiwarits

New Member
Joined
Jul 17, 2022
Messages
34
Office Version
  1. 365
Platform
  1. Windows
Hi guys,

I have tried to add conditional format with EOMONTH function.

But I'm not sure what I do wrong, they make the condition that I made but not on the last day of month.


In the below picture: The condition should appear on 30Apr and last day of the other month that what I expect.
1675313505094.png
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
It works for me.
WorkBook1.xlsx
BCDEFG
1
2
3
412/29/2022FALSE
512/30/2022FALSE
612/31/2022TRUE
71/1/2023FALSE
81/2/2023FALSE
Sheet1
Cell Formulas
RangeFormula
F4:F8F4=C4=EOMONTH(C4,0)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C:CExpression=C1=EOMONTH(C1,0)textNO
 
Upvote 0
Are your values in ROW(4) actual dates? Or just the day of the month number?
 
Upvote 0
It works using the day formatted as just "d":

WorkBook1.xlsx
ABCD
112/29/2022
2
3
429
530
631
71
82
Sheet1
Cell Formulas
RangeFormula
C4C4=B1
C5:C8C5=C4+1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B1Expression=B1=EOMONTH(B1,0)textNO
C:CExpression=C1=EOMONTH(C1,0)textNO
 
Upvote 0
It works if you apply it correctly. It appears that when yo applied the CF rule =I4=EOMONTH(I4,0) you had the whole of row 4 selected.
Select the whole of row 4 again and Conditional Formatting -> Clear Rules -> Clear Rules from Selected Cells
Then select from I4 and as far right as you want and apply the rule again.
 
Upvote 0
Solution
Are your values in ROW(4) actual dates?
It looks like it. You can see the formula in cell I4 pointing at the date in D2. So, pretty safe to assume the others values in the row are dates as well I think. :)
 
Upvote 0
It works if you apply it correctly. It appears that when yo applied the CF rule =I4=EOMONTH(I4,0) you had the whole of row 4 selected.
Select the whole of row 4 again and Conditional Formatting -> Clear Rules -> Clear Rules from Selected Cells
Then select from I4 and as far right as you want and apply the rule again.
Thanks!

Because I applied the entire of the row so the condition appear wrong.
 
Upvote 0
It works using the day formatted as just "d":

WorkBook1.xlsx
ABCD
112/29/2022
2
3
429
530
631
71
82
Sheet1
Cell Formulas
RangeFormula
C4C4=B1
C5:C8C5=C4+1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B1Expression=B1=EOMONTH(B1,0)textNO
C:CExpression=C1=EOMONTH(C1,0)textNO
Thank for your reply and explanation.
 
Upvote 0
Because I applied the entire of the row so the condition appear wrong.
Not sure if you are asking for clarification about that, but here it is.
When you apply a CF formula, the formula applies to the active cell and then adjusts for all the other cells.
When you had the whole row selected, the active cell is A4.
So the formula =I4=EOMONTH(I4,0) when applied to A4 says: "If the cell 8 cells to the right of me is the end of the month of the cell 8 cells to the right of me then format me."
When that logic gets applied across, in AD4 it still says "If the cell 8 cells to the right of me is the end of the month of the cell 8 cells to the right of me then format me."
8 cells to the right of AD4 is AL4 and AL4 (30 Apr 23) is equal to EOMONTH(30-Apr-23,0) so format me (AL4). That's why AL4 is green in your image.
 
Upvote 0
Not sure if you are asking for clarification about that, but here it is.
When you apply a CF formula, the formula applies to the active cell and then adjusts for all the other cells.
When you had the whole row selected, the active cell is A4.
So the formula =I4=EOMONTH(I4,0) when applied to A4 says: "If the cell 8 cells to the right of me is the end of the month of the cell 8 cells to the right of me then format me."
When that logic gets applied across, in AD4 it still says "If the cell 8 cells to the right of me is the end of the month of the cell 8 cells to the right of me then format me."
8 cells to the right of AD4 is AL4 and AL4 (30 Apr 23) is equal to EOMONTH(30-Apr-23,0) so format me (AL4). That's why AL4 is green in your image.
Hi Peter!

Thank you! thanks for the kind explanation. It is really helpful.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,876
Members
452,363
Latest member
merico17

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