SOLVED

Conditional Formatting between certain dates

%3CLINGO-SUB%20id%3D%22lingo-sub-2276877%22%20slang%3D%22en-US%22%3EConditional%20Formatting%20between%20certain%20dates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2276877%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20date%20collumn%20and%20a%20number%20that%20was%20completed%20on%20that%20date.%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EI%20want%20a%20forumla%20that%20will%20alert%20me%20if%20i%20try%20and%20put%20the%20same%20number%20on%20another%20row%20WITHIN%206%20months%20of%20that%20first%20date.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EExample%3A%26nbsp%3B%3C%2FP%3E%3CP%3EJanuary%204th%20-%204201%26nbsp%3B%3C%2FP%3E%3CP%3EFebruary%2010th%20-%204201%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20it%20to%20highlight%20that%20because%20its%20WITHIN%206%20months%20of%20each%20other.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EColumn%20information.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDate%20Column%20is%20C%3C%2FP%3E%3CP%3ENumber%20Columns%20are%20F%20-%20O%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2276877%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-2277004%22%20slang%3D%22en-US%22%3ERe%3A%20Conditional%20Formatting%20between%20certain%20dates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2277004%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1029111%22%20target%3D%22_blank%22%3E%40NConde%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20is%20what%20I%20get.%20I%20drew%20lines%20for%20the%20first%20occurrences.%3C%2FP%3E%0A%3CP%3EPerhaps%20I%20misinterpreted%20your%20question.%20If%20so%2C%20please%20explain%20in%20more%20detail%20what%20you%20want.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22S0305.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F273550i7FDCDA0C09C3BCE1%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22S0305.png%22%20alt%3D%22S0305.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%E2%80%83%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2276991%22%20slang%3D%22en-US%22%3ERe%3A%20Conditional%20Formatting%20between%20certain%20dates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2276991%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F127945%22%20target%3D%22_blank%22%3E%40Hans%20Vogelaar%3C%2FA%3E%26nbsp%3BThat%20didnt%20work%2C%20They%20didnt%20highlight%20if%20they%20were%20within%206%20months.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2276911%22%20slang%3D%22en-US%22%3ERe%3A%20Conditional%20Formatting%20between%20certain%20dates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2276911%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1029111%22%20target%3D%22_blank%22%3E%40NConde%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAssuming%20that%20your%20data%20begin%20on%20row%201%3A%3C%2FP%3E%0A%3CP%3ESelect%20F2%3AK%3CEM%3En%3C%2FEM%3E%20where%20%3CEM%3En%3C%2FEM%3E%20is%20the%20last%20used%20row.%3C%2FP%3E%0A%3CP%3EF2%20should%20be%20the%20active%20cell%20within%20the%20selection.%3C%2FP%3E%0A%3CP%3ECreate%20a%20conditional%20formatting%20rule%20of%20the%20formula%20type%20with%20the%20following%20formula%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DSUMPRODUCT((%24F%241%3A%24K1%3DF2)*(%24C%241%3A%24C1%26gt%3B%3DEDATE(%24C2%2C-6)))%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2288195%22%20slang%3D%22en-US%22%3ERe%3A%20Conditional%20Formatting%20between%20certain%20dates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2288195%22%20slang%3D%22en-US%22%3EThe%20formula%20is%20on%20my%20spreadsheet%20in%203%20different%20sections%2C%20its%20working%20perfectly%20for%202%20of%20the%203%20locations%2C%20The%203rd%20location%20on%20the%20tracker%20the%20formula%20is%20almost%20upside%20down%2C%20Instead%20of%20highlighting%20the%202nd%20date%20being%20within%206%20months%2C%20its%20highlighting%20the%20first%20date.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2288240%22%20slang%3D%22en-US%22%3ERe%3A%20Conditional%20Formatting%20between%20certain%20dates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2288240%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1029111%22%20target%3D%22_blank%22%3E%40NConde%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAre%20the%20dates%20sorted%20differently%20in%20the%203rd%20section%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2288275%22%20slang%3D%22en-US%22%3ERe%3A%20Conditional%20Formatting%20between%20certain%20dates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2288275%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1029111%22%20target%3D%22_blank%22%3E%40NConde%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECould%20you%20attach%20a%20small%20sample%20workbook%20that%20demonstrates%20the%20problem%2C%20but%20without%20sensitive%20data%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I have a date collumn and a number that was completed on that date. 


I want a forumla that will alert me if i try and put the same number on another row WITHIN 6 months of that first date.

 

Example: 

January 4th - 4201 

February 10th - 4201

 

I want it to highlight that because its WITHIN 6 months of each other.


Column information.

 

Date Column is C

Number Columns are F - O

 

 

10 Replies

@NConde 

Assuming that your data begin on row 1:

Select F2:Kn where n is the last used row.

F2 should be the active cell within the selection.

Create a conditional formatting rule of the formula type with the following formula:

 

=SUMPRODUCT(($F$1:$K1=F2)*($C$1:$C1>=EDATE($C2,-6)))

@Hans Vogelaar That didnt work, They didnt highlight if they were within 6 months. 

best response confirmed by NConde (Occasional Contributor)
Solution

@NConde 

This is what I get. I drew lines for the first occurrences.

Perhaps I misinterpreted your question. If so, please explain in more detail what you want.

 

S0305.png

The formula is on my spreadsheet in 3 different sections, its working perfectly for 2 of the 3 locations, The 3rd location on the tracker the formula is almost upside down, Instead of highlighting the 2nd date being within 6 months, its highlighting the first date.

@NConde 

Are the dates sorted differently in the 3rd section?

Nope exactly the same, infact it uses the same date column as the other ones

First section
=SUMPRODUCT(($F$9:$O9=F10)*($C$9:$C9>=EDATE($C10,-5)))
Second section
=SUMPRODUCT(($Q$9:$V9=Q10)*($C$9:$C9>=EDATE($C10,-5)))
third section - section thats not working properly
=SUMPRODUCT(($X$9:$AA9=X10)*($C$9:$C9>=EDATE($C10,-5)))

@NConde 

Could you attach a small sample workbook that demonstrates the problem, but without sensitive data?

@Hans Vogelaar 

Here is a sample. I appreciate your assistance

@NConde 

Thanks!

The difference is the range you've applied the rule to.

S0344.png

As for the columns to the left, the middle rule should start in row 10, i.e. it should apply to $X$10:$AA$268. Unfortunately, when you edit the Applies to box, the formula will change, so you'll have to make sure that it is

=SUMPRODUCT(($X$9:$AA9=X10)*($C$9:$C9>=EDATE($C10,-5)))

after the edit.

See the attached version.

Thank you! this is now working! I appreciate all of your assistance!