Conditional Format using vlookup, indirect and table reference

LocalManMark

New Member
Joined
Jun 12, 2014
Messages
1
Hi All,

This is my first post so please be patient.

I have simplified what I want to achieve in the following example using kids building blocks of different sizes.

First I have a reference table called BlockTypes

[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Block[/TD]
[TD]Size[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]2[/TD]
[/TR]
</tbody>[/TABLE]

I then have a table that lists the spaces and what block is in each space Table1
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Space[/TD]
[TD]Block[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

So the logic above is that because Space 3 contains a block of type C it takes up 2 spaces, Therefore nothing can go into Space 4. The same goes for Space 7 and 8. (I do hope I'm explaining this well :rolleyes:.)


What I want to achieve: I want to create a conditional format to Fill the block cell for 4 and 8 black.

Formula's I have tested
Ideally I would like to use this formula as a conditional format

=NOT(ISERROR((VLOOKUP((INDIRECT(ADDRESS(ROW()-1,COLUMN()))),BlockTypes,2,FALSE)=2)))

This works as a cell formula but not as a "Conditional Format" Formula

The following simple fomula works but would be difficult to manage if more blocks with different sizes were introduced.

=INDIRECT(ADDRESS(ROW()-1,COLUMN()))="C"

Theory on Issue
I am wondering if this issue is to do with the reference to the Table "BlockTypes", but I can't see any other way around it.

Hope someone can understand my question and help :biggrin:
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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