Help with VLOOKUP and then 2 possible calculations

Eskonn

New Member
Joined
Mar 28, 2018
Messages
26
Office Version
  1. 365
Platform
  1. Windows
I need help with a calculation

In Row 1 below I have a vlookup that is returning a value in column H. Then multiplying that by Column D.
Here is the formula I have and it works correctly.

=IFERROR(VLOOKUP(D2,'Product Data'!A:F,6,FALSE),"")*G2
for the first line the vlookup value is 80.82 x 5 (D2) = 404.10


A B C D E F G H
Item #DescriptionSizeMissing
Case QTY
Total InvoicedMissing
Bottle QTY
Total Invoiced BottlesTotal $ Loss
3000one1.750 LT5404.10
975695two750.000 ML2


But if cell d is blank I would like to then divide the vlookup result in H by column F.

Also if there is a value in both Column D and F I would like to do both calculations and then add them together.

Hope this makes sense
Let me know if any other information is needed
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
But if cell d is blank I would like to then divide the vlookup result in H by column F.
If D is blank then the result of the vlookup would be an error so there would be nothing to divide.
In theory, I'm guessing that you will need something like this however your question doesn't make enough sense for me to provide anything more accurate.
Excel Formula:
=(IFERROR(VLOOKUP(D2,'Product Data'!A:F,6,FALSE),"")*G2)+(IFERROR(VLOOKUP(F2,'Product Data'!A:F,6,FALSE),"")/G2)
 
Upvote 0
If D is blank then the result of the vlookup would be an error so there would be nothing to divide.
In theory, I'm guessing that you will need something like this however your question doesn't make enough sense for me to provide anything more accurate.
Excel Formula:
=(IFERROR(VLOOKUP(D2,'Product Data'!A:F,6,FALSE),"")*G2)+(IFERROR(VLOOKUP(F2,'Product Data'!A:F,6,FALSE),"")/G2)

The only reason I I have the if error is so that on rows where I don't have any data yet it just returns it as blank.

In my example I didn't use all of the columns that are on my sheet so the VLOOKUP formula is off
Below in another example with all of the columns

A B C D E F G H I J K
MonthInvoiced DateInvoice #Item #DescriptionSizeMissing
Case QTY
Total InvoicedMissing
Bottle QTY
Total Invoiced BottlesTotal $ Loss
February3000one1.750 LT5#DIV/0!
November975695two750.000 ML2

Your suggestion does work if I have a value in both G and I or in just I.

But if there is just a value in G I am getting the error you can see above in K
 
Upvote 0
I should have made a couple of other changes to the formula,
Excel Formula:
=IFERROR(VLOOKUP(D2,'Product Data'!A:F,6,FALSE)*G2,0)+IFERROR(VLOOKUP(F2,'Product Data'!A:F,6,FALSE)/G2,0))
If that is not what you need, please use XL2BB (link at the foot of this reply) to post your data sample, when you copy and paste as you have done it tends to go out of alignment.
 
Upvote 0
Solution
This worked!

Thanks for taking the time to help with this.
Unfortunately I am on a work computer so the XL2BB add in wont install unless I get our corporate IT involved.

Thanks again, I appreciate the help!!
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,891
Members
449,058
Latest member
Guy Boot

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