Lookup, return date from unknown column

Akashwani

Well-known Member
Joined
Mar 14, 2009
Messages
2,911
Hi,

I'm going around in circles of frustration here.

Excel Workbook
ABCDEFGHIJKLMNOPQR
1NameAnimalAmount200020012002200320042005200620072008200920102011201220132014
2BillCat100.00********Jan***Dec**
3JoDog250.00***Mar**Nov********
4Bobmouse350.00************Mar*Mar
5SueRabbit500.00Jan**Mar***********
6******************
7******************
8NameAnimalAmountYear1Year2*************
9JoDog250.0030/01/200831/12/2012*************
10******************
11NameAnimalAmountYear1Year2*************
12SueRabbit500.0030/01/200031/03/2003*************
Sheet3


How do I return the values for D9:E9 or D12:E12?
I have tried numerous variations of Vlookup/Index/Match all without the desired result, obviously :rofl:

The data in D2:R5 are true dates formatted to display the month, the data in row 1 are numbers, if that makes any difference!!

Thanks

Ak
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi,

I'm going around in circles of frustration here.

Excel Workbook
ABCDEFGHIJKLMNOPQR
1NameAnimalAmount200020012002200320042005200620072008200920102011201220132014
2BillCat100.00********Jan***Dec**
3JoDog250.00***Mar**Nov********
4Bobmouse350.00************Mar*Mar
5SueRabbit500.00Jan**Mar***********
6******************
7******************
8NameAnimalAmountYear1Year2*************
9JoDog250.0030/01/200831/12/2012*************
10******************
11NameAnimalAmountYear1Year2*************
12SueRabbit500.0030/01/200031/03/2003*************
Sheet3


How do I return the values for D9:E9 or D12:E12?
I have tried numerous variations of Vlookup/Index/Match all without the desired result, obviously :rofl:

The data in D2:R5 are true dates formatted to display the month, the data in row 1 are numbers, if that makes any difference!!

Thanks

Ak
Are you looking for the column header dates for cells that are not empty?

So, the correct results for "Joe" "Dog" "250" would be 2003 and 2006?
 
Upvote 0
Hi Biff,

Thanks for showing an interest.
I need to return the value on the same row, :oops: I've just realised I gave the wrong result in my previous sample data, sorry, that's how scrambled my brain is with this...

Excel Workbook
ABCDEFGHIJKLMNOPQR
1NameAnimalAmount200020012002200320042005200620072008200920102011201220132014
2BillCat100.00********Jan***Dec**
3JoDog250.00***Mar**Nov********
4Bobmouse350.00************Mar*Mar
5SueRabbit500.00Jan**Mar***********
6******************
7******************
8NameAnimalAmountYear1Year2*************
9JoDog250.0030/03/200331/11/2006*************
Sheet3


So, I need Jo, Dog, £250, Value of G3 and Value of J3.

Sorry about the confusion.

Ak
 
Upvote 0
Hi Biff,

Thanks for showing an interest.
I need to return the value on the same row, :oops: I've just realised I gave the wrong result in my previous sample data, sorry, that's how scrambled my brain is with this...

Excel Workbook
ABCDEFGHIJKLMNOPQR
1NameAnimalAmount200020012002200320042005200620072008200920102011201220132014
2BillCat100.00********Jan***Dec**
3JoDog250.00***Mar**Nov********
4Bobmouse350.00************Mar*Mar
5SueRabbit500.00Jan**Mar***********
6******************
7******************
8NameAnimalAmountYear1Year2*************
9JoDog250.0030/03/200331/11/2006*************
Sheet3


So, I need Jo, Dog, £250, Value of G3 and Value of J3.

Sorry about the confusion.

Ak
Ok, so you DO want to do what I asked! ;)

Try this array formula** entered in D9:

=INDEX($D$1:$R$1,SMALL(IF(INDEX($D$2:$R$5,MATCH(1,IF($A$2:$A$5=$A9,IF($B$2:$B$5=$B9,IF($C$2:$C$5=$C9,1))),0),0)<>"",COLUMN($D$2:$R$5)),COLUMNS($D9:D9))-COLUMN($D2)+1)

** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.

Copy across to E9.
 
Upvote 0
Hi Biff,

Thanks for showing an interest.
I need to return the value on the same row, :oops: I've just realised I gave the wrong result in my previous sample data, sorry, that's how scrambled my brain is with this...

Excel Workbook
ABCDEFGHIJKLMNOPQR
1NameAnimalAmount200020012002200320042005200620072008200920102011201220132014
2BillCat100.00********Jan***Dec**
3JoDog250.00***Mar**Nov********
4Bobmouse350.00************Mar*Mar
5SueRabbit500.00Jan**Mar***********
6******************
7******************
8NameAnimalAmountYear1Year2*************
9JoDog250.0030/03/200331/11/2006*************
Sheet3


So, I need Jo, Dog, £250, Value of G3 and Value of J3.

Sorry about the confusion.

Ak

Akashwani,

Or try this formulas (B9, C9, D9 and E9):

=INDEX($B$2:$B$5,MATCH(A9,$A$2:$A$5,0))

=INDEX($C$2:$C$5,MATCH(A9,$A$2:$A$5,0))

=SMALL(INDIRECT("D"&MATCH(A9,$A$2:$A$5,0)+ROW($A$1)&":R"&MATCH(A9,$A$2:$A$5,0)+ROW($A$1)),1)

=LARGE(INDIRECT("D"&MATCH(A9,$A$2:$A$5,0)+ROW($A$1)&":R"&MATCH(A9,$A$2:$A$5,0)+ROW($A$1)),1)


Markmzz
 
Last edited:
Upvote 0
Hi Biff,

No, I'm not looking for the column header, I'm looking for the value below the header, sorry if I confused you.

Hi Mark.

Your formulas did the trick, thank you very much.


Excel Workbook
ABCDEFGHIJKLMNOPQR
1NameAnimalAmount200020012002200320042005200620072008200920102011201220132014
2BillCat100.00********Jan***Dec**
3JoDog250.00***Mar**Nov********
4Bobmouse350.00************Mar*Mar
5SueRabbit500.00Jan**Mar***********
6******************
7******************
8NameAnimalAmountYear1Year2*************
9JoDog25025/03/200330/11/2006*2003***********
Sheet3



Thanks to you both, I can now move on and try to do something simple :eeek:
Stand by chaps, it's going to be a long night :rofl:

Thanks again.

Ak
 
Upvote 0
Hi Mark,

I have an after thought here!!
How would I apply your Small and Large formulas if I were looking up on a different sheet?

Excel Workbook
ABCDEFGHIJKLMNOPQR
1NameAnimalAmount200020012002200320042005200620072008200920102011201220132014
2BillCat100.00********Jan***Dec**
3JoDog250.00***Mar**Nov********
4Bobmouse350.00************Mar*Mar
5SueRabbit500.00Jan**Mar***********
Sheet3



Excel Workbook
ABCDE
8NameAnimalAmountYear1Year2
9JoDog250#N/A#N/A
Sheet4


Thanks

Ak
 
Upvote 0
Hi Biff,

No, I'm not looking for the column header, I'm looking for the value below the header, sorry if I confused you.
I've been confused a lot lately! :laugh:

OK, then that makes things easier!

Array enterd** in D9:

=SMALL(INDEX($D$2:$R$5,MATCH(1,IF($A$2:$A$5=$A9,IF($B$2:$B$5=$B9,IF($C$2:$C$5=$C9,1))),0),0),COLUMNS($D9:D9))

** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.

Format as Date

Copy across to E9.
 
Upvote 0
Akashwani,

Try this in D9 and E9:

=SMALL(INDIRECT("Sheet3!D"&MATCH(A9,Sheet3!$A$2:$A$5,0)+ROW(Sheet3!$A$1)&":R"&MATCH(Sheet3!A9,$A$2:$A$5,0)+ROW(Sheet3!$A$1)),1)

=LARGE(INDIRECT("Sheet3!D"&MATCH(A9,Sheet3!$A$2:$A$5,0)+ROW(Sheet3!$A$1)&":R"&MATCH(Sheet3!A9,$A$2:$A$5,0)+ROW(Sheet3!$A$1)),1)

Markmzz
 
Upvote 0
Hi Biff,

I'm sorry if I'm causing you anything other than amusement :rofl:
Your formula is perfect, thank you very much.

Hi Mark,
I had to tweak your formulas and they also work perfectly, thanks.

=SMALL(INDIRECT("Sheet3!D"&MATCH(A9,Sheet3!$A$2:$A$5,0)+ROW(Sheet3!$A$1)&":R"&MATCH(A9,Sheet3!$A$2:$A$5,0)+ROW(Sheet3!$A$1)),1)

=LARGE(INDIRECT("Sheet3!D"&MATCH(A9,Sheet3!$A$2:$A$5,0)+ROW(Sheet3!$A$1)&":R"&MATCH(A9,Sheet3!$A$2:$A$5,0)+ROW(Sheet3!$A$1)),1)

Once again, thanks to both of you.

Ak
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,476
Members
452,915
Latest member
hannnahheileen

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