VLOOKUP or INDEX/MATCH or similar

James8761

Board Regular
Joined
Apr 24, 2012
Messages
154
Office Version
  1. 2019
Platform
  1. Windows
Hi,

I have been given a sample of data. I would like the end user to enter in to two cells (B2 and B3) and the third cell (B4) would give the answer. One of the probelms I have is that I ahve a set of numbers grouped in one cell (B7). I just want to pick one of those numbers. An example is below. Is there a formula that could be placed in cell B4 that would give the correct answer of 4500 please?

1613059954429.png


Thanks for any help,
James
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi James,

Here's a solution that works fine with Excel 365.

Cell C2 formula to show which row matches your Weight value:

Rich (BB code):
=MAX(IF(ISNUMBER(SEARCH(B2,B7:B10)),ROW(B7:B10)-6,0))

Edit: Alternatively, if you don't have Office 365, this formula seems to work with earlier versions:

Rich (BB code):
=SUMPRODUCT(IF(ISNUMBER(SEARCH(B2,B7:B10)),ROW(B7:B10)-6,0))

Cell D2 formula to show which column matches your Volume value:

Rich (BB code):
=MATCH(B3,C6:G6)

Now you can combine these two in cell B4:

Rich (BB code):
=INDEX(C7:G10,C2,C3)

1613062128782.png


1613062140273.png
 
Upvote 0
Solution
A couple other options:
Note the INDEX formula in cell B4 of the example below is an array formula that probably will need to be entered with CTRL-SHIFT-ENTER in Excel 2019.
Book1
ABCDEFG
1
2WT15
3VL400ml
4Answer45004500
5
6WT100ml200ml300ml400ml500ml
710,12,13,14,15,1630003500400045005000
820,21,23,27,2932003400360038004000
931,33,35,37,3838003950410042504400
Sheet1
Cell Formulas
RangeFormula
B4B4=INDEX($C$7:$G$9,MATCH(TRUE,ISNUMBER(SEARCH($B$2,$B$7:$B$9)),0),MATCH($B$3,$C$6:$G$6,0))
D4D4=SUMPRODUCT(((ISNUMBER(SEARCH($B$2,$B$7:$B$9))*($C$6:$G$6=$B$3)*($C$7:$G$9))))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Hi James,

Here's a solution that works fine with Excel 365.

Cell C2 formula to show which row matches your Weight value:

Rich (BB code):
=MAX(IF(ISNUMBER(SEARCH(B2,B7:B10)),ROW(B7:B10)-6,0))

Edit: Alternatively, if you don't have Office 365, this formula seems to work with earlier versions:

Rich (BB code):
=SUMPRODUCT(IF(ISNUMBER(SEARCH(B2,B7:B10)),ROW(B7:B10)-6,0))

Cell D2 formula to show which column matches your Volume value:

Rich (BB code):
=MATCH(B3,C6:G6)

Now you can combine these two in cell B4:

Rich (BB code):
=INDEX(C7:G10,C2,C3)

View attachment 31834

View attachment 31835
Excellent, thank you very much for this. Does exazctly what I want.
 
Upvote 0
A couple other options:
Note the INDEX formula in cell B4 of the example below is an array formula that probably will need to be entered with CTRL-SHIFT-ENTER in Excel 2019.
Book1
ABCDEFG
1
2WT15
3VL400ml
4Answer45004500
5
6WT100ml200ml300ml400ml500ml
710,12,13,14,15,1630003500400045005000
820,21,23,27,2932003400360038004000
931,33,35,37,3838003950410042504400
Sheet1
Cell Formulas
RangeFormula
B4B4=INDEX($C$7:$G$9,MATCH(TRUE,ISNUMBER(SEARCH($B$2,$B$7:$B$9)),0),MATCH($B$3,$C$6:$G$6,0))
D4D4=SUMPRODUCT(((ISNUMBER(SEARCH($B$2,$B$7:$B$9))*($C$6:$G$6=$B$3)*($C$7:$G$9))))
Press CTRL+SHIFT+ENTER to enter array formulas.
Thank you as well for the response. I shall keep this one as well. (y)
 
Upvote 0

Forum statistics

Threads
1,214,648
Messages
6,120,725
Members
448,987
Latest member
marion_davis

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