VLOOKUP - Multiply by a percentage if appropriate

Hoopsah

Board Regular
Joined
Jul 27, 2007
Messages
74
Office Version
  1. 365
Hi All,

Wonder if you can help.

I've attached a sample worksheet showing roughly what I'm trying to achieve - I'm completely stumped.

Column B just shows an item code.
Column C shows the quantity
Column D is the rate for the item
Column E is where the formula that I need help with is.

If (In column E) it looks up the table and there is a whole number then just multiply rate x quantity. BUT, if the rate is a percentage then multiply by the percent.

I can only get it to multiply the whole number and not differentiate.

I've added a column (F) to show the answer that it should be.

Thanks all

(P.S. I'll probably be posting this in VBA Express too as I'm really hoping to have an answer before my team meeting tomorrow - Thanks again)

Hoopsah

ItemQtyRateFormula used in Col DExtnFormula used in Col DAnswer required
A.1£ 100.000.07VLOOKUP(C3,M:N,2,FALSE)£ 7.00D3*E3£ 107.00A.17%
A.25329.23VLOOKUP(C4,M:N,2,FALSE)£ 1,646.15D4*E4A.2£ 329.23
A.3221.36VLOOKUP(C5,M:N,2,FALSE)£ 42.72D5*E5A.3£ 21.36
A.4£ 230.000.20VLOOKUP(C6,M:N,2,FALSE)£ 46.00D6*E6£ 276.00A.420%
A.5£ 150.000.10VLOOKUP(C7,M:N,2,FALSE)£ 15.00D7*E7£ 165.00A.510%
A.6325VLOOKUP(C8,M:N,2,FALSE)£ 75.00D8*E8A.6£ 25.00
A.7433VLOOKUP(C9,M:N,2,FALSE)£ 132.00D9*E9A.7£ 33.00
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Not to worry everyone - Got ann answer on VBA Express - Formula in column D should be: =IF(D3<1,1+D3,D3)*C3
 
Upvote 0
will you have a value less than 1 - as percents should all be less than 1 giving your example

so perhaps an IF with the vlookup()

=IF( VLOOKUP(C3,M:N,2,FALSE) < 1 , D3*VLOOKUP(C3,M:N,2,FALSE), C3*D3)
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

If you are using 365, you can make use of the new LET function, which can simplify/shorten the solution etaf posted, as you would only need to perform the VLOOKUP function once.
 
Upvote 0
In future please provide links if you cross-post on other forums. Thanks.
Yes, I had already asked them to do that in a Private Message.

Hoopsah, please provide that link to this thread, and be sure to always do this if Cross Posting here in the future.
Failure to follow these rules may lead to disciplinary action.
 
Upvote 0
Sorry all - been a while since I've been on here.
Updated the version of Excel that I'm using in my profile (365) and the link to the question and answer on VBA Express is:

 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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