Conditional formatting highlighting cells that contain "P" that are overdue on monthly base

crombes

New Member
Joined
Mar 17, 2005
Messages
22
hi everyone, i'm struggling to get this together
I want to highlight cells that contain the value "P" and are past due seen on monthly base
so all cells that have P in it from jan to sep should highlight blue and those in oct till dec not
I've tried several formulas but somehow it highlight other cells also

can anyone help

trial audit.xlsm
BCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJBKBL
1AUDITPLAN 2021
2Q-eng Q-expQ-inspectorjan/21feb/21mrt/21apr/21mei/21jun/21jul/21aug/21sep/21okt/21nov/21dec/21
4dgwDGW+LCRMNPPPANZANPPPAPPAAAZAN714lcrm@picanol.bekdvl@picanol.be
5pcsrPCSR+JMSSAA135lcrm@picanol.belcrm@picanol.be
6pcsr-dgwLNZPAAAAAAAAAAAAAAAAAAAAAAA66lcrm@picanol.bekdvl@picanol.bePgrijper31/01/2021
7JPSGJPSGPPPAAZAAAPPP0Alucht28/02/2021
8grijperluchtgrijperluchtgrijperluchtgrijperluchtgrijperluchtN31/03/2021
9DGWLNZPAAAA Z30/04/2021
10DGWLNZ+DGWPAAAP31/05/2021
11JVLS-Zaman 1x OPIA30/06/2021
12DGWLNZAPAPNA31/07/2021
13PDRTLNZAAAAAAAAAA31/08/2021
14dgwDGWAAAAPA30/09/2021
15dgwDDHNAAAAAA31/10/2021
16dgwDDHNAAAAPAA30/11/2021
17allenPPPP31/12/2021
18auditeeLGLLFDPDDDHNSDHNJVRBFVDNLGLLFDPD DDHNSDHNJVRBFVDN
19auditorPCSRDGWLCRMJMSS1SDHYPDRTJPSGLVDLPCSRDGWSDHYJMSS1
20DgwAAAAAAAAAAA
21dgwDDHNAAAAAAAAAA
22dgwdgwAAAAAAAAAAFALSE
23dgwdgwAAA
24JPSGLNZAAAAAAAAAAA
25SDHY
26auditor DGWSDHNPCSRDDHNJMSS1LGLLSDHYJVBRFVDNFDPDLNZLVDL
27PCSRLNZAAAAAA
auditkalender 2022
Cell Formulas
RangeFormula
H2,L2,P2,T2,X2,AB2,AF2,AJ2,AN2,AR2,AV2H2=EOMONTH(D2,0)+1
BC4BC4=IFERROR(COUNTIF(OFFSET($D4,,,,MATCH(DATE(YEAR(TODAY()),MONTH(TODAY()),1),$D$2:$AY$2,0)-1),"P"),"Wrong year")
BD4BD4=IFERROR(COUNTIF(OFFSET($D4,,MATCH(DATE(YEAR(TODAY()),MONTH(TODAY()),1),$D$2:$AY$2,0)-1,,4),"P"),"Wrong year")
BC22BC22=AND(MONTH(D2)<>MONTH(TODAY()),A6="P",TODAY()-BL6>0)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AJ4:AM27Expression=AND(AJ4 ="P";MONTH($BL$14)=MONTH(TODAY()))textNO
AV4:AY27Expression=AND(AV4 ="P";MONTH($BL$17)=MONTH(TODAY()))textNO
AR4:AU27Expression=AND(AR4 ="P";MONTH($BL$16)=MONTH(TODAY()))textNO
AN4:AQ27Expression=AND(AN4 ="P";MONTH($BL$15)=MONTH(TODAY()))textNO
D27:AY27,D26,AB26,H26,L26,P26,T26,X26,AD26:AG26,AJ26,AV26,AN26,AR26,AY26,D4:AY25Cell Value="N"textNO
D27:AY27,D26,AB26,H26,L26,P26,T26,X26,AD26:AG26,AJ26,AV26,AN26,AR26,AY26,D4:AY25Cell Value="Z"textNO
D27:AY27,D26,AB26,H26,L26,P26,T26,X26,AD26:AG26,AJ26,AV26,AN26,AR26,AY26,D4:AY25Cell Value="A"textNO
Y5:Y7,Y9:Y16,Y20:Y25,Y27Expression=AND(MONTH($AJ$3)<>MONTH(TODAY());Y5="P";TODAY()-$AL$3>0)textNO
Y5:Y7,Y9:Y16,Y20:Y25,Y27Expression=AND(MONTH($AJ$3)=MONTH(TODAY());Y5="P")textNO
AB5:AC7,AB9:AC16,AB8,AB20:AC25,AB18:AB19,AB27:AC27,AB26Expression=MONTH($AB$3)=MONTH(TODAY())textNO
X5:AA7,X9:AA16,X8,X20:AA25,X27:AA27Expression=MONTH($X$3)=MONTH(TODAY())textNO
T5:X7,T9:X16,T8,X8,T20:X25,T27:X27Expression=MONTH($T$3)=MONTH(TODAY())textNO
P5:S7,P9:S16,P8,P20:S25,P27:S27Expression=MONTH($P$3)=MONTH(TODAY())textNO
L5:O7,L9:O16,L8,L20:O25,L27:O27Expression=MONTH($L$3)=MONTH(TODAY())textNO
H5:K7,H9:K16,H8,H20:K25,H27:K27Expression=MONTH($H$3)=MONTH(TODAY())textNO
Y4Expression=AND(MONTH($AJ$3)<>MONTH(TODAY());Y4="P";TODAY()-$AL$3>0)textNO
Y4Expression=AND(MONTH($AJ$3)=MONTH(TODAY());Y4="P")textNO
AB4:AC4Expression=MONTH($AB$3)=MONTH(TODAY())textNO
X4:AA4Expression=MONTH($X$3)=MONTH(TODAY())textNO
T4:X4Expression=MONTH($T$3)=MONTH(TODAY())textNO
P4:S4Expression=MONTH($P$3)=MONTH(TODAY())textNO
L4:O4Expression=MONTH($L$3)=MONTH(TODAY())textNO
H4:K4Expression=MONTH($H$3)=MONTH(TODAY())textNO
D4:G4Expression=MONTH($D$3)=MONTH(TODAY())textNO
Cells with Data Validation
CellAllowCriteria
D4:AY4List=$BJ$6:$BJ$10
AY5:AY27List=$BJ$6:$BJ$10
D17:AC17List=$BJ$6:$BJ$10
AG17:AX17List=$BJ$6:$BJ$10
AN12:AQ12List=$BJ$6:$BJ$10
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hi crombes,

Hope these work for you. I'm sure there is a more delicate way to form the formulas but as long as it works, it works :D

Please ignore row 6 as I was trying the formula to show the months < to this month.

Also keep in mind that this formula will work only on the same year, if current date is February 2022 and you want to check for October 2021, this will not work as it compares months only, not month + year.

Excel Formula:
=AND(NUMBERVALUE(TEXT(A$1,"M"))<NUMBERVALUE(TEXT(NOW(),"M")),A2="P")


1635514144966.png

1635514011389.png
 
Upvote 0
Solution

Forum statistics

Threads
1,223,228
Messages
6,170,871
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