Two way lookup with if/match return

sanrama

New Member
Joined
May 2, 2015
Messages
23
Office Version
  1. 2013
Platform
  1. Windows
Hi All,

Need help, I am struggling to find the solution. Below is my details,


ABCDEFGHIJ
1NameDate12345678
2DayFriSatSunMonTueWedThuFri
3Mr. ABBBAAOBA
4Mr. BAAOBBLOB
5Mr. CLOLLLBAA
6Mr. DGBOGGLGG
7Mr. EGGAOGLGG


Case 1
Lookup 12Date ( in raw 1 )
Lookup 2BColumn F ( Lookup 1 matching column, in this case it matching column array is G3:G7 )
Result 1Mr. A
Result 2Mr. D
Result 3
Result 4

Case 2
Lookup 16Date ( in raw 1 )
Lookup 2LColumn F ( Lookup 1 matching column, in this case it matching column array is K3:K7 )
Result 1Mr. B
Result 2Mr. D
Result 3Mr. E
Result 4



Thanks in advance
 
It works no different to your formula if you insert above the first row of data in that it will not include the inserted rows in the calculations.

If you insert rows above the headers then it would fail but I would say that is a bit of an unusual practice.

Normally I would use the entire column for the INDEX range, I just reduced it this time so that the results table was not in the precedent range although it will work fine either way.
 
Upvote 0

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
@jasonb75 and @Fluff , you both make excellent points (and we have yet to hear from the OP if any satisfy their requirement) but I believe you are both missing the the most important aspect of this thread.
Toadstool posted an Excel 2013 solution first! ;)
 
Upvote 0
@jasonb75
B13 formula is not working but C13 formula is working, seems I am making some mistake in B13 formula

@Fluff @Toadstool
Your formula is also working nicely

Thanks guys for providing the solution
 
Upvote 0
@Fluff @Toadstool @jasonb75
Is there any solution for dragging formula horizontal instead of vertical ?
Horizontal = B13, C13, D13, E13,.... ( keeping raw 13 constant )
Vertical = B13, B14, B15, B16,....( Keeping column B constant )

Thanks in advance
 
Upvote 0
Sanrama,

I'm not sure if I'm following correctly but do you mean like this?

Sanrama.xlsx
ABCDEFGHI
1Name12345678
2DayFriSatSunMonTueWedThuFri
3Mr. ABBBAAOBA
4Mr. BAAOBBLOB
5Mr. CLOLLLBAA
6Mr. DGBOGGLGG
7Mr. EGGAOGLGG
8
9Lookup 1Lookup 2
102BMr. AMr. D     
116LMr. BMr. DMr. E    
128GMr. DMr. E     
135GMr. DMr. E     
14       
Sheet1 (2)
Cell Formulas
RangeFormula
C10:I14C10=IFERROR(INDEX($A$3:$A$7,AGGREGATE(15,6,ROW($A$3:$A$7)-ROW($A$2)/(($B$1:$I$1=$A10)*($B$3:$I$7=$B10)),COLUMN()-COLUMN($B$10))),"")
 
Upvote 0
Hi @Fluff

Your formula is satisfying my requirement as I have inserted some raw above the first row of my datasheet.
Can we convert your formula to horizontal drag instead of vertical drag formula like Toadstook suggested.

Thanks
 
Upvote 0
How about
+Fluff v2.xlsm
ABCDEFGHI
1Name12345678
2DayFriSatSunMonTueWedThuFri
3Mr. ABBBAAOBA
4Mr. BAAOBBLOB
5Mr. CLOLLLBAA
6Mr. DGBOGGLGG
7Mr. EGGAOGLGG
8
9Lookup 1Lookup 2
102BMr. AMr. D     
116LMr. BMr. DMr. E    
128GMr. DMr. E     
135GMr. DMr. E     
14      
Data
Cell Formulas
RangeFormula
C10:I13D10=IFERROR(INDEX($A$3:$A$7,AGGREGATE(15,6,(ROW($B$3:$I$7)-ROW($B$3)+1)/($B$1:$I$1=$A10)/($B$3:$I$7=$B10),COLUMNS($B$10:C10))),"")
D14:I14D14=IFERROR(INDEX($A$3:$A$7,AGGREGATE(15,6,ROW($A$3:$A$7)-ROW($A$2)/(($B$1:$I$1=$A14)*($B$3:$I$7=$B14)),COLUMN()-COLUMN($B$10))),"")
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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