Hlookup - Is this the best way to do what I need?

RJSIGKITS

Board Regular
Joined
Apr 15, 2013
Messages
109
Hi Guys.

So, I have a sheet that has a 'Shopping list' with a load of products that need to be ordered for a specific 'Model'.
Column A = item description
Columns B-D (random other info)
Column E = cost price per item.
Columns F to K = Qty - all columns have the model names in Row3 (F3:K3), and the columns below (F4:K75) show the qty of product that is required for that specific model.
Column L needs to return the total cost of the qty of products required.

Cell C1 is where the user simply selects which Model is to be Quoted..

"=HLOOKUP($C$1,$F$3:$K$75,2,FALSE)*E4" seems too cumbersome to keep changing the Row index manually on each line, plus if I need to add extra rows, this will mess up the whole thing.

Can anyone help me with what the best way to do this would be, please?

The forum won't allow me to attach an example!

Thanks in advance.
 
Last edited:

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
The forum won't allow me to attach an example!
But it does allow copyable screen shots like this. My signature block below has help with that.

Does this, copied down, do what you want?


Book1
CDEFGHIJKL
1Model 4
2Cost/Item
3Model 1Model 2Model 3Model 4Model 5Model 6Total Cost
4514352225
522524138
633433229
Total Cost
Cell Formulas
RangeFormula
L4=E4*INDEX(F4:K4,MATCH(C$1,F$3:K$3,0))
 
Upvote 0
Thank you, James

using INDEX and match I totally missed!
I did keep trying with LOOKUP and match, but completely didn't think about INDEX!

Thank you!
 
Upvote 0
But it does allow copyable screen shots like this. My signature block below has help with that.

Does this, copied down, do what you want?

CDEFGHIJKL
1Model 4
2Cost/Item
3Model 1Model 2Model 3Model 4Model 5Model 6Total Cost
4514352225
522524138
633433229

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Total Cost

Worksheet Formulas
CellFormula
L4=E4*INDEX(F4:K4,MATCH(C$1,F$3:K$3,0))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

All advice is perfect here, thanks!
Why I didn't try with INDEX, I'll never know!

Your line is 100% what I need!
 
Upvote 0
Glad you could fix your problem with the INDEX-MATCH combination ...:wink:
 
Upvote 0
All advice is perfect here, thanks!
Why I didn't try with INDEX, I'll never know!

Your line is 100% what I need!
You are welcome. :)

Since all rows are using the same model column, you could save some processing power and simplify the formulas by just calculating the MATCH once (I've used cell D1) instead of on every line & then only using INDEX in each row.

Excel Workbook
CDEFGHIJKL
1Model 44
2Cost/Item
3Model 1Model 2Model 3Model 4Model 5Model 6Total Cost
4514352225
522524138
633433229
Total Cost
 
Upvote 0
You are welcome. :)

Since all rows are using the same model column, you could save some processing power and simplify the formulas by just calculating the MATCH once (I've used cell D1) instead of on every line & then only using INDEX in each row.

Total Cost

CDEFGHIJKL
1Model 44
2 Cost/Item
3 Model 1Model 2Model 3Model 4Model 5Model 6Total Cost
4 514352225
5 22524138
6 33433229

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:65px;"><col style="width:26px;"><col style="width:75px;"><col style="width:65px;"><col style="width:65px;"><col style="width:65px;"><col style="width:65px;"><col style="width:65px;"><col style="width:65px;"><col style="width:78px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
D1=MATCH(C1,F3:K3,0)
L4=E4*INDEX(F4:K4,D$1)

<tbody>
</tbody>

<tbody>
</tbody>

I like that a lot! Thanks again!
(y)
 
Upvote 0
I like that a lot! Thanks again!
(y)
Cheers. :)

BTW, best not to fully quote longish posts as it makes the thread harder to read/navigate. If you want to quote, quote small, relevant parts only.
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,702
Members
449,048
Latest member
81jamesacct

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