SOLVED
Home

Conditional formatting with custom formula: revenue value in last three months

%3CLINGO-SUB%20id%3D%22lingo-sub-673823%22%20slang%3D%22en-US%22%3EConditional%20formatting%20with%20custom%20formula%3A%20revenue%20value%20in%20last%20three%20months%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-673823%22%20slang%3D%22en-US%22%3E%3CP%3EHi!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20got%20a%20custom%20formula%20for%20conditional%20formatting%20I'd%20like%20some%20help%20with.%20This%20URL%20holds%20a%20copy%20example%20of%20my%20original%20file%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fd%2F1wp3AMnlZr0hgRBLbQlMBgHe-a-g3VQOeFiCEgVZaUwU%2Fedit%3Fusp%3Dsharing%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fd%2F1wp3AMnlZr0hgRBLbQlMBgHe-a-g3VQOeFiCEgVZaUwU%2Fedit%3Fusp%3Dsharing%3C%2FA%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3EIt's%20a%20file%20with%20revenue%20data%20per%20customer%20per%20month.%20What%20I%20need%20is%20to%20highlight%20the%20last%20three%20months%20if%20there%20is%20no%20revenue%20or%20revenue%20under%20200%20EUR%20per%20month.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EI've%20got%20the%20part%20covered%20on%20how%20to%20highlight%20the%20last%20three%20months%20with%20the%20following%20formula%3A%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%3DAND(MONTH(U%241)%3CMONTH%3EMONTH(TODAY())-4)%3C%2FMONTH%3E%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3ETo%20check%20the%20revenue%20I%20added%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3E%3BSUM(U2%3AW2)%26lt%3B350%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eto%20the%20formula%2C%20but%20this%20isn't%20right.%20As%20the%20capture%20shows%2C%20in%20row%202%20it%20highlights%20the%200%20EUR%20-%20even%20though%20this%20is%20obviously%20an%20active%20customer.%20Then%20in%20row%204%2C%20the%20months%20of%20April%20and%20May%20aren't%20highlighted%20even%20though%20they%20should%20be..%20I%20also%20tried%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3E%3BU2%26lt%3B200%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ebut%20this%20too%20highlights%20individual%20cells%20and%20not%20the%20combination%20of%20the%20last%20three%3C%2FDIV%3E%3CDIV%3Emonths.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EAny%20ideas%20on%20how%20I%20can%20get%20this%20part%20of%20the%20formula%20to%20work%3F%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20979px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F117331i889DAC192FB39920%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Capture.JPG%22%20title%3D%22Capture.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EThanks!%3C%2FDIV%3E%3CDIV%3E-%20Noortje%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-673823%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-676432%22%20slang%3D%22en-US%22%3ERe%3A%20Conditional%20formatting%20with%20custom%20formula%3A%20revenue%20value%20in%20last%20three%20months%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-676432%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F120436%22%20target%3D%22_blank%22%3E%40Noortje%20Vollenberg%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHi%20Noortje%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20mean%20to%20check%20if%20this%20year%20revenue%20is%20less%20from%20350%2C%20i.e.%20from%20Jan%20to%20running%20month%2C%20when%20you%20have%20to%20fix%20Jan%20in%20formula%20by%20absolute%20reference%3A%3C%2FP%3E%0A%3CPRE%3E%3DAND(MONTH(U%241)%3CMONTH%3EMONTH(TODAY())-4%2CSUM(%3CFONT%20color%3D%22%23FF0000%22%3E%3CSTRONG%3E%24U2%3C%2FSTRONG%3E%3C%2FFONT%3E%3AW2)%26lt%3B350)%3C%2FMONTH%3E%3C%2FPRE%3E%0A%3CP%3EPlease%20check%20in%20attached%20file.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-686305%22%20slang%3D%22en-US%22%3ERe%3A%20Conditional%20formatting%20with%20custom%20formula%3A%20revenue%20value%20in%20last%20three%20months%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-686305%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20Sergei%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20your%20response!%20What%20I'm%20looking%20for%20is%20actually%20not%20fixed%20(i.e.%20revenue%20from%20Jan%20-%20now)%2C%20but%20should%20adapt%20to%20always%20include%20the%20last%20three%20months%20(i.e.%20revenue%20from%20March%20-%20May%20at%20this%20point%20in%20time).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMeaning%3A%20at%20this%20point%20in%20time%20it%20should%20highlight%20March%20-%20May%20revenue%20if%20it%20is%20less%20than%20350.%20If%20it%20were%20currently%20November%2C%20it%20should%20highlight%20August%20-%20October%20revenue%20if%20less%20than%20350%20combined%20(or%20%26lt%3B200%20per%20month).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20this%20possible%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-686424%22%20slang%3D%22en-US%22%3ERe%3A%20Conditional%20formatting%20with%20custom%20formula%3A%20revenue%20value%20in%20last%20three%20months%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-686424%22%20slang%3D%22en-US%22%3EPerhaps%20this%20illustrates%20better%20what%20I%20am%20looking%20for%3A%3CBR%20%2F%3E%3CBR%20%2F%3EIt's%20currently%20June%2C%20meaning%20that%20the%203%20month%20period%20I'm%20looking%20at%20is%20March%20to%20May.%20I%20need%20these%20three%20months%20to%20be%20highlighted%20if%20every%20one%20of%20these%20months'revenue%20is%20below%20200%2C%20or%20the%20combined%20revenue%20is%20below%20350%20(whichever%20works%20better%20in%20a%20formula).%3CBR%20%2F%3E%3CBR%20%2F%3ESo%20if%20March%3D0%2C%20April%3D500%2C%20May%3D10%20then%20this%20shouldn't%20be%20highlighted%20(the%20revenue%20in%20April%20shows%20this%20is%20an%20active%20customer).%3CBR%20%2F%3E%3CBR%20%2F%3EBut%20if%20March%3D10%2C%20April%3D120%2C%20May%3D30%20then%20these%20three%20months%20should%20be%20highlighted%20(this%20revenue%20does%20not%20show%20an%20active%20customer%20as%20the%20values%20are%20too%20low%20for%20significant%20purchases).%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-687482%22%20slang%3D%22en-US%22%3ERe%3A%20Conditional%20formatting%20with%20custom%20formula%3A%20revenue%20value%20in%20last%20three%20months%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-687482%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F120436%22%20target%3D%22_blank%22%3E%40Noortje%20Vollenberg%3C%2FA%3E%26nbsp%3B%2C%20formula%20rule%20could%20be%3C%2FP%3E%0A%3CPRE%3E%3D((SUMPRODUCT(%20((%24U%241%3A%24AF%241%26lt%3BEOMONTH(TODAY()%2C-1))*(%24U%241%3A%24AF%241%26gt%3BEOMONTH(TODAY()%2C-4)))*%24U2%3A%24AF2)%26lt%3B350)%2B(SUMPRODUCT(%20((%24U%241%3A%24AF%241%26lt%3BEOMONTH(TODAY()%2C-1))*(%24U%241%3A%24AF%241%26gt%3BEOMONTH(TODAY()%2C-4)))*(%24U2%3A%24AF2%26lt%3B200))%3D3))*(U%241%26lt%3BEOMONTH(TODAY()%2C-1))*(U%241%26gt%3BEOMONTH(TODAY()%2C-4))%3C%2FPRE%3E%0A%3CP%3EPlease%20check%20attached%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-689359%22%20slang%3D%22en-US%22%3ERe%3A%20Conditional%20formatting%20with%20custom%20formula%3A%20revenue%20value%20in%20last%20three%20months%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-689359%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20Sergei%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20so%20much%20for%20your%20help.%20This%20is%20working%20perfectly!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20added%20a%20second%20variation%20of%20the%20formula%20with%20AND(%20....%20%3BU2%3D0)%20to%20hide%20the%20text%20for%20cells%20with%20a%20value%20of%200%20so%20the%20file%20is%20more%20legible.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-689766%22%20slang%3D%22en-US%22%3ERe%3A%20Conditional%20formatting%20with%20custom%20formula%3A%20revenue%20value%20in%20last%20three%20months%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-689766%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F120436%22%20target%3D%22_blank%22%3E%40Noortje%20Vollenberg%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20see%2C%20didn't%20think%20about%20all%20zeroes.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Noortje Vollenberg
Occasional Contributor

Hi!

 

I've got a custom formula for conditional formatting I'd like some help with. This URL holds a copy example of my original file: https://docs.google.com/spreadsheets/d/1wp3AMnlZr0hgRBLbQlMBgHe-a-g3VQOeFiCEgVZaUwU/edit?usp=sharing.

 

It's a file with revenue data per customer per month. What I need is to highlight the last three months if there is no revenue or revenue under 200 EUR per month.
 
I've got the part covered on how to highlight the last three months with the following formula:
=AND(MONTH(U$1)<MONTH(TODAY());MONTH(U$1)>MONTH(TODAY())-4)
 
To check the revenue I added ;SUM(U2:W2)<350 to the formula, but this isn't right. As the capture shows, in row 2 it highlights the 0 EUR - even though this is obviously an active customer. Then in row 4, the months of April and May aren't highlighted even though they should be.. I also tried ;U2<200 but this too highlights individual cells and not the combination of the last three
months.
 
Any ideas on how I can get this part of the formula to work?
 
Capture.JPG
 
Thanks!
- Noortje
6 Replies

@Noortje Vollenberg 

Hi Noortje,

 

If you mean to check if this year revenue is less from 350, i.e. from Jan to running month, when you have to fix Jan in formula by absolute reference:

=AND(MONTH(U$1)<MONTH(TODAY()),MONTH(U$1)>MONTH(TODAY())-4,SUM($U2:W2)<350)

Please check in attached file.

@Sergei Baklan 

Hi Sergei,

 

Thanks for your response! What I'm looking for is actually not fixed (i.e. revenue from Jan - now), but should adapt to always include the last three months (i.e. revenue from March - May at this point in time).

 

Meaning: at this point in time it should highlight March - May revenue if it is less than 350. If it were currently November, it should highlight August - October revenue if less than 350 combined (or <200 per month).

 

Is this possible?

Perhaps this illustrates better what I am looking for:

It's currently June, meaning that the 3 month period I'm looking at is March to May. I need these three months to be highlighted if every one of these months'revenue is below 200, or the combined revenue is below 350 (whichever works better in a formula).

So if March=0, April=500, May=10 then this shouldn't be highlighted (the revenue in April shows this is an active customer).

But if March=10, April=120, May=30 then these three months should be highlighted (this revenue does not show an active customer as the values are too low for significant purchases).
Solution

@Noortje Vollenberg , formula rule could be

=((SUMPRODUCT( (($U$1:$AF$1<EOMONTH(TODAY(),-1))*($U$1:$AF$1>EOMONTH(TODAY(),-4)))*$U2:$AF2)<350)+(SUMPRODUCT( (($U$1:$AF$1<EOMONTH(TODAY(),-1))*($U$1:$AF$1>EOMONTH(TODAY(),-4)))*($U2:$AF2<200))=3))*(U$1<EOMONTH(TODAY(),-1))*(U$1>EOMONTH(TODAY(),-4))

Please check attached

 

@Sergei Baklan 

 

Hi Sergei,

 

Thanks so much for your help. This is working perfectly!

 

I've added a second variation of the formula with AND( .... ;U2=0) to hide the text for cells with a value of 0 so the file is more legible.

@Noortje Vollenberg 

 

I see, didn't think about all zeroes. 

Related Conversations