SOLVED

Conditional Formatting of Cells based on variable input in other cells.

%3CLINGO-SUB%20id%3D%22lingo-sub-2558274%22%20slang%3D%22en-US%22%3EConditional%20Formatting%20of%20Cells%20based%20on%20variable%20input%20in%20other%20cells.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2558274%22%20slang%3D%22en-US%22%3E%3CP%3EI%20would%20like%20to%20highlight%20%2F%20conditionally%20format%20the%20cells%20containing%20%22data%22%20Row%2023%20(item%2010%20data%20b23%3AO23)%20which%20have%20numbers%20that%20match%20those%20%22variables%22%20placed%20in%20Row%2012%20(item%2010%20variables%20b12%3Ak12).%20See%20screenshot%20attached.%26nbsp%3B%20The%20rows%20are%20necessarily%20different%20sizes%20(%23%20of%20cells)%2C%20and%20each%20row%20of%20%22variables%22%20may%20contain%20different%20numbers%20of%20populated%20cells%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20dumbed%20this%20way%20down%2C%20as%20I%20just%20want%20to%20get%20this%20working%20then%20can%20apply%20more%20globally.%26nbsp%3B%20Intent%20is%20that%20I%20will%20be%20doing%20this%20for%20the%20remainder%20of%20the%20rows%20as%20well%20(i.e.%20item%201%20selections%20with%20item%201)%2C%20so%20ability%20to%20replicate%20easily%20would%20be%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20tried%20a%20number%20of%20different%20intuitive%20options%20(%3Dor)%20and%20also%20done%20some%20searching%20and%20saw%20a%20%3Dcountif%20option%20(which%20did%20not%20work...but%20didn't%20understand%20it%20to%20be%20honest).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENot%20sure%20why%20this%20is%20so%20complex....%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2558274%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2558293%22%20slang%3D%22en-US%22%3ERe%3A%20Conditional%20Formatting%20of%20Cells%20based%20on%20variable%20input%20in%20other%20cells.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2558293%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1105895%22%20target%3D%22_blank%22%3E%40ScottMN%3C%2FA%3E%26nbsp%3BPerhaps%20something%20like%20in%20the%20attached%20file%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2559225%22%20slang%3D%22en-US%22%3ERe%3A%20Conditional%20Formatting%20of%20Cells%20based%20on%20variable%20input%20in%20other%20cells.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2559225%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E-%26nbsp%3Bsmashed%20it!%26nbsp%3B%20That%20is%20awesome.%26nbsp%3B%20I%20wish%20I%20understood%20the%20logic%20in%20the%20back%20a%20bit%20more%20to%20make%20it%20more%20intuitive%20(and%20know%20that%20some%20of%20these%20other%20cool%20functions%20exist)%20-%20but%20Ill%20take%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAppreciate%20the%20prompt%20response%20mate%20-%20really%20helps%20me%20out.%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2559408%22%20slang%3D%22en-US%22%3ERe%3A%20Conditional%20Formatting%20of%20Cells%20based%20on%20variable%20input%20in%20other%20cells.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2559408%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1105895%22%20target%3D%22_blank%22%3E%40ScottMN%3C%2FA%3E%26nbsp%3BConditional%20Formatting%20(CF)%2C%20unfortunately%2C%20isn't%20always%20intuitive.%20Think%20of%20it%20this%20way.%20The%20range%20you%20want%20to%20format%20is%20B14%3AO23.%20That%20will%20thus%20be%20in%20the%20the%20%22Applied%20to%22%20field%20with%20dollar%20signs%20to%20make%20the%20references%20absolute.%20Now%2C%20the%20rule%20that%20checks%20if%20the%20numbers%20in%20the%20top%20part%20of%20the%20sheet%20exist%20in%20the%20bottom%20part%20uses%20MATCH.%20If%20the%20number%20exists%20it%20produces%20a%20number%20(representing%20the%20position%20where%20the%20number%20was%20found)%20or%20%23N%2FA.%3C%2FP%3E%3CP%3EThen%20ISNUMBER(.......)%20will%20return%20ether%20TRUE%20or%20FALSE.%20Put%20it%20all%20in%20one%20CF%20rule%20like%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DISNUMBER(MATCH(B14%2C%24B3%3A%24O3%2C0))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EApplied%20to%20the%20range%20mentioned%20above%20will%20lead%20to%20all%20cells%20with%20TRUE%20to%20be%20formatted.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20attached%20file%20includes%20a%20few%20extra%20rows%20to%20demonstrate%20just%20that%20with%20the%20MATCH%20part%20of%20the%20above%20formula%20entered%20in%20B25%2C%20copied%20across%20and%20down%20and%20the%20ISNUMBER%20formula%20in%20the%20rows%20below%20that.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20you'll%20find%20it%20useful.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I would like to highlight / conditionally format the cells containing "data" Row 23 (item 10 data b23:O23) which have numbers that match those "variables" placed in Row 12 (item 10 variables b12:k12). See screenshot attached.  The rows are necessarily different sizes (# of cells), and each row of "variables" may contain different numbers of populated cells

 

I've dumbed this way down, as I just want to get this working then can apply more globally.  Intent is that I will be doing this for the remainder of the rows as well (i.e. item 1 selections with item 1), so ability to replicate easily would be appreciated.

 

I've tried a number of different intuitive options (=or) and also done some searching and saw a =countif option (which did not work...but didn't understand it to be honest).

 

Not sure why this is so complex.... 

3 Replies
best response confirmed by allyreckerman (Microsoft)
Solution

@ScottMN Perhaps something like in the attached file?

 

@Riny_van_Eekelen- smashed it!  That is awesome.  I wish I understood the logic in the back a bit more to make it more intuitive (and know that some of these other cool functions exist) - but Ill take it.

 

Appreciate the prompt response mate - really helps me out.   

@ScottMN Conditional Formatting (CF), unfortunately, isn't always intuitive. Think of it this way. The range you want to format is B14:O23. That will thus be in the the "Applied to" field with dollar signs to make the references absolute. Now, the rule that checks if the numbers in the top part of the sheet exist in the bottom part uses MATCH. If the number exists it produces a number (representing the position where the number was found) or #N/A.

Then ISNUMBER(.......) will return ether TRUE or FALSE. Put it all in one CF rule like this:

 

=ISNUMBER(MATCH(B14,$B3:$O3,0))

 

 

Applied to the range mentioned above will lead to all cells with TRUE to be formatted.

 

The attached file includes a few extra rows to demonstrate just that with the MATCH part of the above formula entered in B25, copied across and down and the ISNUMBER formula in the rows below that.

 

Hope you'll find it useful.