Home > Net >  Excel Conditional formatting on two criteria in a separate table
Excel Conditional formatting on two criteria in a separate table

Time:03-30

This is a reporting presentation exercise...

I am looking for the magic to change the colour of the cell without changing the contents of the cell.

I have a type of crosstab table, which has the ROWS individual CustomerIDs, and the COLs as months.

PRESENTATION TABLE

CustomerID Jan 22 Feb 22 Mar 22
0001 $100 $50 $10000
0002 $1000 $1000 $200
.... .... ...

And in a separate table, I have some data which I want to use in a conditional formatting type of way.

LOOKUP TABLE

CustomerID Period Label
0001 Feb 22 Applied
0001 Mar 22 Pending
0006 Mar 22 Approved
0009 Dec 23 Pending

Let's say that if the CustomerID and Period in the data table has the label "Applied" then I want that cell in the top table, where CustomerID and Period intersect, to be coloured RED. If it's "Passed", I want it to be coloured green, and so on.

The periods are dates data types. The tables are excel tables.

The dollar value in the cell has nothing to do with it.

I've seen some techniques where a combination of Named ranges and confditional formatting are used, but I'm stumped.

I can put the dollar values in the correct cell by putting a helper column into my source data (the second table) and then doing an xlookup on the combination of the row and col headers, against that helper column.

But then I run out of steam.

END RESULT

CustomerID Jan 22 Feb 22 Mar 22
0001 RED BLUE
0002
.... .... ...

CodePudding user response:

Conditional Formatting On Two Criteria In A Separate Table

This is what I have tried,

CONDITIONAL_FORMATTING

• Formula used in Conditional Formatting for Applied

=COUNTIFS($F$2:$F$5,$A2,$G$2:$G$5,B$1,$H$2:$H$5,"Applied")=1

Special credit to Scott Craner Sir for the above formula

• And for the Pending you may try using SUMPRODUCT() or COUNTIFS() Function as well, both way it works,

=SUMPRODUCT(($A2=$F$2:$F$5)*(B$1=$G$2:$G$5)*($H$2:$H$5="Pending"))=1
  • Related