On a matrix: If cells are marked, show table header value in corresponding row (with line breaks).

Chuck Rittersdorf

New Member
Joined
May 14, 2018
Messages
7
What is the best way to do the following:

If one (or more cells) within a range on a matrix is marked (e.g. with "X"), show the value of the header in that column in the cell of the corresponding row left in the matrix (column B in my example).

If more than one cell (on a row) is marked, the values should be shown separated by a line break (on Mac and PC, I've heard there are issues).

Here is an image to explain what I mean:

problem_orig.png



I've tried an IF-function, but it does not accept ranges. I've considered Lookup, but my Excel-skills are too limited to use it... I'm working on a matrix with lots of rows and columns, so I need something copyable and hence time saving.

Please advice and thanks for your help.
 
You might get it to go a little faster if you put

Code:
Application.ScreenUpdating = False

before your loop, and

Code:
Application.ScreenUpdating = True

after it. Other than that, I'm just glad you got an acceptable solution!
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,214,650
Messages
6,120,736
Members
448,988
Latest member
BB_Unlv

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