Match+Indexing within conditional formating.

baggi

New Member
Joined
Aug 24, 2018
Messages
3
Hello all,

I have a spread sheet with three columns, A master list, master approvals, and a checklist.

The first column is the master list of serial numbers, and the master approvals column next to it says whether or not the unit is approved (Yes, No, or blank). These two columns correspond to each other.

I want to be able to paste a short list into the third column, and have it format any cells that are not approved or blank.

I am not able to include an example spreadsheet, so I am using Columns A, B, and C corresponding to the Master list, master approvals, and the checklist, respectively. I want Column C (the checklist) to conditionally format based on the value in Column B, where the value of Column C and A are equal.

The formula that I have been trying to use within conditional formatting is:

=(INDEX($B:$B, MATCH(C2,$A:$A,0))="No") <-----for cases when the unit is not approved
=(INDEX($B:$B, MATCH(C2,$A:$A,0))="") <-----for cases when the approval is blank

I am pretty new to using more complex formulas beyond 'Sum' and 'Count', So I likely am missing something. But hey, I'm always up for learning more. Thank you in advance!
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Welcome to the forum!

See if this works for you - adjust the ranges of cols A & B to match your data.

Code:
=OR(INDEX($B$2:$B$100,MATCH($C2,$A$2:$A$100,0))="No",INDEX($B$2:$B$100,MATCH($C2,$A$2:$A$100,0))="")
 
Upvote 0
That almost works! It applies the formatting in column 'C' one block above the correct cell however. Row 1 of the sheet is the heading, Row 2 below is data; so I'm not sure why the formula as written is not working.
 
Upvote 0
That almost works! It applies the formatting in column 'C' one block above the correct cell however. Row 1 of the sheet is the heading, Row 2 below is data; so I'm not sure why the formula as written is not working.
Did you copy the formula directly from your browser or did you re-type it? Did you select the cells you want to CF prior to setting the CF formula, being careful not to include the header cell?

Works fine for me so I'm guessing you are not applying it correctly.
 
Upvote 0
I agree with JoeMo about why it is offset by 1 row. If you have a heading in row 1, you would select from C2 down and then apply the Conditional formatting given by JoeMo.

The same applies for this alternative. Select C2:Cxx then apply this formula (& adjust the $100 to be big enough to cover any expected data)

Excel Workbook
ABC
1SNApprovedCheck
2SN1YesSN5
3SN2SN8
4SN3NoSN4
5SN4NoSN1
6SN5SN2
7SN6YesSN10
8SN7Yes
9SN8Yes
10SN9
11SN10No
CF Not Approved
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C21. / Formula is =VLOOKUP(C2,A$2:B$100,2,0)<>"Yes"Abc
 
Last edited:
Upvote 0
Did you copy the formula directly from your browser or did you re-type it? Did you select the cells you want to CF prior to setting the CF formula, being careful not to include the header cell?

Works fine for me so I'm guessing you are not applying it correctly.


I had the CF being applied to the whole column. Changing the range to one starting at the second row fixed the issue. Thank you all for your help.
 
Upvote 0
I had the CF being applied to the whole column. Changing the range to one starting at the second row fixed the issue. Thank you all for your help.
Glad to contribute. :)

Hopefully you put a reasonable end-row on the CF as well. CF is volatile so recalculates every time anything on the sheet recalculates so can have a negative impact on sheet performance, especially if applied to hundreds of thousands of cells needlessly.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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