Conditional Find > Replace Macro

jackieros

New Member
Joined
Nov 24, 2017
Messages
3
I have an excel (generated from a polling app) in this format:

Person 1 Person 2 Person 3 Person 4
Option A Yes Yes
Option B Yes
Option C Yes


What I ultimately want is a list of the options and who selected each one.

People
Option A Person 1 | Person 4
Option B Person 2
Option C Person 3

====================
What I figured I need to do is first do a conditional find and replace that will check if there a particular column is not blank (or can check if contains "Yes"), and if so, replace that value with same column's row 1 value.

After that, would need to create a new column, where each cell checked in current row, and for each non blank value in that row, copy that value to the current cell.

I assume this will require a macro, which is beyond my Excel abilities. Welcome anyone who can help with this.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
You could possibly use a formula; depends on how many rows and columns you're working on. For example:


Book1
ABCDE
1Person 1Person 2Person 3Person 4
2Option AYesYes
3Option BYes
4Option CYes
5
6Option APerson 1 | Person 4
7Option BPerson 2
8Option CPerson 3
Sheet1
Cell Formulas
RangeFormula
B6{=MID(CONCAT(IF(INDEX($B$2:$E$4,MATCH($A6,$A$2:$A$4,0),)="Yes"," | " & $B$1:$E$1,"")),4,65535)}
Press CTRL+SHIFT+ENTER to enter array formulas.


WBD
 
Upvote 0
Thanks for the quick reply, and it's a nice option, but we're talking about around 40 people and 20 options, so I think that would be a bit much to address with a formula...
 
Upvote 0
=ROW(INDIRECT(MID("WBD",TRUE,NOT(FALSE))&SQRT(SQRT(16))+4))*COLUMN(INDIRECT(MID("OMG",ROUNDUP(LOG(1000,10),0),1)&MATCH(" WBD ",{" WE "," LOVE "," WBD "},0)))

:laugh:
 
Upvote 0
Thanks for the quick reply, and it's a nice option, but we're talking about around 40 people and 20 options, so I think that would be a bit much to address with a formula...

I think it's worth a try!


Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAO
1Person 1Person 2Person 3Person 4Person 5Person 6Person 7Person 8Person 9Person 10Person 11Person 12Person 13Person 14Person 15Person 16Person 17Person 18Person 19Person 20Person 21Person 22Person 23Person 24Person 25Person 26Person 27Person 28Person 29Person 30Person 31Person 32Person 33Person 34Person 35Person 36Person 37Person 38Person 39Person 40
2Option AYesYesYesYesYesYesYesYesYesYes
3Option BYesYesYesYesYesYesYesYesYesYesYes
4Option CYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYes
5Option DYesYesYesYesYesYesYesYesYes
6Option EYesYesYesYesYesYesYesYes
7Option FYesYesYesYesYesYesYesYesYesYesYes
8Option GYesYesYesYesYesYesYesYesYesYesYesYesYes
9Option HYesYesYesYesYesYesYesYesYesYesYesYes
10Option IYesYesYesYesYesYesYesYesYesYesYesYesYes
11Option JYesYesYesYesYesYesYesYesYesYesYesYesYesYesYes
12Option KYesYesYesYesYesYesYesYesYesYesYesYesYes
13Option LYesYesYesYesYesYesYesYesYesYes
14Option MYesYesYesYesYesYesYesYesYesYesYesYes
15Option NYesYesYesYesYesYesYesYesYesYes
16Option OYesYesYesYesYesYesYesYesYesYesYesYesYesYes
17Option PYesYesYesYesYesYesYes
18Option QYesYesYesYesYesYesYesYesYesYesYesYes
19Option RYesYesYesYesYesYesYesYesYesYes
20Option SYesYesYesYesYesYesYesYesYes
21Option TYesYesYesYesYesYesYesYesYesYesYesYes
22
23
24Option APerson 3 | Person 5 | Person 11 | Person 15 | Person 17 | Person 20 | Person 23 | Person 31 | Person 37 | Person 40
25Option BPerson 2 | Person 6 | Person 9 | Person 12 | Person 13 | Person 22 | Person 24 | Person 25 | Person 34 | Person 39 | Person 40
26Option CPerson 1 | Person 3 | Person 7 | Person 8 | Person 9 | Person 10 | Person 12 | Person 14 | Person 17 | Person 22 | Person 24 | Person 27 | Person 28 | Person 36 | Person 37 | Person 39
27Option DPerson 1 | Person 5 | Person 8 | Person 15 | Person 19 | Person 20 | Person 25 | Person 29 | Person 38
28Option EPerson 11 | Person 12 | Person 15 | Person 17 | Person 20 | Person 21 | Person 30 | Person 36
29Option FPerson 1 | Person 7 | Person 8 | Person 15 | Person 18 | Person 22 | Person 23 | Person 24 | Person 26 | Person 36 | Person 38
30Option GPerson 2 | Person 3 | Person 5 | Person 10 | Person 11 | Person 13 | Person 14 | Person 18 | Person 21 | Person 30 | Person 31 | Person 34 | Person 39
31Option HPerson 3 | Person 5 | Person 7 | Person 9 | Person 11 | Person 14 | Person 20 | Person 24 | Person 27 | Person 29 | Person 31 | Person 38
32Option IPerson 8 | Person 13 | Person 14 | Person 15 | Person 19 | Person 22 | Person 26 | Person 31 | Person 32 | Person 33 | Person 35 | Person 36 | Person 37
33Option JPerson 1 | Person 5 | Person 6 | Person 7 | Person 8 | Person 9 | Person 13 | Person 15 | Person 20 | Person 23 | Person 24 | Person 27 | Person 28 | Person 31 | Person 37
34Option KPerson 1 | Person 3 | Person 6 | Person 10 | Person 12 | Person 21 | Person 23 | Person 28 | Person 29 | Person 30 | Person 31 | Person 33 | Person 35
35Option LPerson 3 | Person 4 | Person 9 | Person 13 | Person 15 | Person 18 | Person 22 | Person 26 | Person 34 | Person 38
36Option MPerson 5 | Person 9 | Person 10 | Person 11 | Person 12 | Person 15 | Person 16 | Person 21 | Person 24 | Person 26 | Person 28 | Person 33
37Option NPerson 2 | Person 6 | Person 7 | Person 8 | Person 14 | Person 26 | Person 27 | Person 28 | Person 38 | Person 40
38Option OPerson 1 | Person 6 | Person 7 | Person 10 | Person 12 | Person 13 | Person 16 | Person 20 | Person 24 | Person 28 | Person 31 | Person 32 | Person 38 | Person 39
39Option PPerson 4 | Person 6 | Person 12 | Person 20 | Person 23 | Person 29 | Person 33
40Option QPerson 2 | Person 9 | Person 12 | Person 15 | Person 16 | Person 22 | Person 30 | Person 31 | Person 32 | Person 33 | Person 36 | Person 38
41Option RPerson 1 | Person 2 | Person 12 | Person 16 | Person 19 | Person 25 | Person 26 | Person 32 | Person 35 | Person 39
42Option SPerson 4 | Person 13 | Person 14 | Person 19 | Person 22 | Person 23 | Person 33 | Person 34 | Person 36
43Option TPerson 2 | Person 6 | Person 7 | Person 11 | Person 15 | Person 20 | Person 23 | Person 24 | Person 25 | Person 27 | Person 31 | Person 38
Sheet1
Cell Formulas
RangeFormula
B24{=MID(CONCAT(IF(INDEX($B$2:$AO$21,MATCH($A24,$A$2:$A$21,0),)="Yes"," | "&$B$1:$AO$1,"")),4,65535)}
Press CTRL+SHIFT+ENTER to enter array formulas.


:D
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,322
Members
452,635
Latest member
laura12345

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