Displaying multiple values in 1 cell???

killar65

New Member
Joined
Jul 11, 2017
Messages
23
Hey guys,

Need help with a formula...

I have a small table that shows people names (col A) and liked colors (row 1)...see attached pic
example1.jpg


What I'm seeking to do is in col H, show what each person likes color wise...ie...H2 would show red, green, cyan for Frank...H3 would show yellow, blue for Sally etc...

If somebody had no favourite color, then the respective cell in col H would remain blank.

Col's B2 through G5 are in a font style called marlett...pressing "a" on your keyboard produces the tick.

Any helps/thoughts on this would be greatly appreciatted...

Regards,

James
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
With a simple loop
Code:
Sub Maybe()
Dim lr As Long, lc As Long, i As Long, j As Long, clrs
lr = Cells(Rows.Count, 1).End(xlUp).Row
lc = Cells(1, Columns.Count).End(xlToLeft).Column
    For i = 2 To lr
        For j = 2 To lc
            If Cells(i, j).Value = "a" Then clrs = clrs & ", " & Cells(1, j).Value
        Next j
    Cells(i, lc + 1).Value = Mid(clrs, 3)
    clrs = ""
    Next i
End Sub
 
Upvote 0
Hey guys,

Need help with a formula...

I have a small table that shows people names (col A) and liked colors (row 1)...see attached pic
View attachment 103019

What I'm seeking to do is in col H, show what each person likes color wise...ie...H2 would show red, green, cyan for Frank...H3 would show yellow, blue for Sally etc...

If somebody had no favourite color, then the respective cell in col H would remain blank.

Col's B2 through G5 are in a font style called marlett...pressing "a" on your keyboard produces the tick.

Any helps/thoughts on this would be greatly appreciatted...

Regards,

James
you can do it with formula:
Excel Formula:
H2=TEXTJOIN(", ",TRUE,IF(B2:G2="a",$B$1:$G$1,""))
 
Upvote 0
Solution
Jolivanes, Eiloken...

Many thanks for taking the time help out...

Going to go with Eiloken's suggestion as it is the easiest for me to modify and implement...works a treat...

Once again, thanks

James
 
Upvote 0
What version of Excel are you using?
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0

Forum statistics

Threads
1,223,902
Messages
6,175,278
Members
452,629
Latest member
SahilPolekar

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