Match & create a column

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,213
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
ABCDEF
FOOTBALLRUGBYBASEBALLHOCKEY
DANIELHARRYRUGBY
HARRYDANIELFOOTBALL
WILLIAMMICHAELHOCKEY
MICHAELWILLIAMBASEBALL
CarlCARL
JERRYJERRYBASEBALL

<TBODY>
</TBODY><COLGROUP><COL><COL><COL span=3><COL></COLGROUP>

column A=Input & B1, C1, D1 & E1 is Input. B2:B7, C2;C7, D2:D7 & E2:E7 is to be MATCHED EXACTLY with column A to get column F.
How to accomplish?
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Excel 2010
ABCDEF
1FOOTBALLRUGBYBASEBALLHOCKEY
2DANIELHARRYRUGBY
3HARRYDANIELFOOTBALL
4WILLIAMMICHAELHOCKEY
5MICHAELWILLIAMBASEBALL
6CarlCARL
7JERRYJERRYBASEBALL
Sheet3
Cell Formulas
RangeFormula
F2=IF(AND(UPPER(A2)=UPPER(LOOKUP(2,1/($B2:$E2<>""),B2:E2))=TRUE,EXACT(A2,LOOKUP(2,1/($B2:$E2<>""),B2:E2))=FALSE),"",LOOKUP(2,1/($B2:$E2<>""),$B$1:$E$1))
 
Upvote 0
Just a minute!!! In D3 I punched M & in the output cell F3 it shows BASEBALL which is INCORRECT since there is no cell containing M 'ONLY' in A2:A7.
 
Upvote 0
Just a minute!!! In D3 I punched M & in the output cell F3 it shows BASEBALL which is INCORRECT since there is no cell containing M 'ONLY' in A2:A7.


Excel 2010
ABCDEF
1FOOTBALLRUGBYBASEBALLHOCKEY
2DANIELHARRYRUGBY
3HARRYM
4WILLIAMMICHAELHOCKEY
5MICHAELWILLIAMBASEBALL
6CarlCARL
7JERRYJERRYBASEBALL
Sheet3
Cell Formulas
RangeFormula
F2{=IF(SUM(IF(ISNA(EXACT($A$2:$A$7,LOOKUP(2,1/($B2:$E2<>""),$B2:$E2))),"",--EXACT($A$2:$A$7,LOOKUP(2,1/($B2:$E2<>""),$B2:$E2))))=1,LOOKUP(2,1/($B2:$E2<>""),$B$1:$E$1),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
A
B
C
D
E
F
FOOTBALL
RUGBY
BASEBALL
HOCKEY
DANIEL
HARRY
RUGBY
HARRY
DANIEL
FOOTBALL
WILLIAM
MICHAEL
HOCKEY
MICHAEL
WILLIAM
BASEBALL
Carl
CARL
JERRY
JERRY
BASEBALL

<tbody>
</tbody>

column A=Input & B1, C1, D1 & E1 is Input. B2:B7, C2;C7, D2:D7 & E2:E7 is to be MATCHED EXACTLY with column A to get column F.
How to accomplish?

Shorter in number of functions invoked...
Rich (BB code):
=IF(ISNA(LOOKUP(9.99999999999999E+307,
  FIND(" "&LOOKUP(REPT("z",255),B2:E2)&" "," "&$A$2:$A$7&" "))),"",
   LOOKUP(REPT("z",255),B2:E2,$B$1:$E$1))
If you would define BigNum as referring to:
Rich (BB code):
=9.99999999999999E+307
and BigStr as referring to:
Rich (BB code):
=REPT("z",255)
the formula becomes:
Rich (BB code):
=IF(ISNA(LOOKUP(BigNum,
  FIND(" "&LOOKUP(BigStr,B2:E2)&" "," "&$A$2:$A$7&" "))),"",
   LOOKUP(BigStr,B2:E2,$B$1:$E$1))
 
Upvote 0
Aladin's formula works well. But I am unable to decide which one will be more flexible + reliable?
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,317
Members
449,081
Latest member
tanurai

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