An intelligent vlookup formula !

gaftalik

Well-known Member
Joined
Feb 6, 2003
Messages
521
Office Version
  1. 2016
Platform
  1. Windows
Hi,
we know that the vlookup formula look this way :
vlookup(lookup value;table array;col_index_num;range lookup)

if in a table i have 50 columns, shall i count all the columns to see the nbr of the column from which i need to return the value accordingly ,starting from the first column of the table or is there any inteligent formula which by clicking on the needed column itself will exempt me from counting ?!

2) where is the mistake in formula R3 which shall return the same answer as P3?

I appreciate your help , thank you
Book1
ABCDEFGHIJKLMNOPQRST
1
2
3TOTAL
4UTUTUTUTUTUT
5A234567832018A20#N/A
6B21134533121421020B102
7C125789097370
8D385127936180
9
10
11
Sheet1
 

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.
My good friend,
i tried it and the result was 102 as P6 instead of 20 as P5
is there something wrong?
 
Upvote 0
gaftalik said:
My good friend,
i tried it and the result was 102 as P6 instead of 20 as P5
is there something wrong?

Try:

=INDEX($L$5:$M$8,MATCH(O5,$B$5:$B$8,0),MATCH(P$4,$L$4:$M$4,0))

Replace , with ;
Book3
BCDEFGHIJKLMNOPQ
3TOTAL
4UTUTUTUTUTUT
5A23456783A20
6B2113453312142B102
7C125789097
8D385127936
9
Sheet1
 
Upvote 0
It worked nice, thank you you are always there , you are always the solution !

As to my first question defining the column number by other formula in the vlookup formula instead of counting them , do you think it is possible ?
 
Upvote 0
gaftalik said:
...As to my first question defining the column number by other formula in the vlookup formula instead of counting them , do you think it is possible ?

That would not be a problem if the row 4 of your data would consist of distinct items. It's of course possible to use just the L4:M4 part, but the formula would be rather convoluted.
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,691
Members
448,978
Latest member
rrauni

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