How Can one use Sumproduct or Sum with IF(VlookUp or Lookup...........)

RapchikM

New Member
Hello

This is in relation with Thread Unable to derive Simple Multiplication result with IF(AND.... Cell Value 0 or Blank

As criteria changed

How Can I use Sumproduct or Sum with IF(VlookUp or Lookup

You can see
The Cell range from D15:F19 is Fixed

From Row 22 onwards Formula will be draged.

So as per the fixed Range From D15:F19 the following is the result
=((13*100*1.65)+(13*200*4.1)+(13*200*7.45)+(13*500*8.25)/100) = 858
=(SUMPRODUCT(C58*IF(E52:E55=0,100,E\$52:E55)*F\$52:F\$55/100)) = 858

What i want here is in G22 = 677.095 because one condition of lookup or vlookup needs to be added

using below Formula
New formula in G22 =
=B22*(SUMPRODUCT(C22*IF(E52:E55=0,100,(LOOKUP(C22,E\$33:E\$36,E\$33:E\$36)*(C22-LOOKUP(C22,E\$33:E\$36,E\$33:E\$36)*LOOKUP(C22,E\$33:E\$36,F\$33:F\$36))))))

I am getting as 4274400 instead of 66709.50 Somewhere i went wrong

The condition is to look for value C22 and on basis of that using SUMPRODUCT OR SUM with IF(Vlookup or Lookup
or How to achieve the following result with Sumproduct or Sum with Vlookup or Lookup and Cells blank or = 0 in the Range From D15:D19

=((13*100*1.65)+(13*200*4.1)+(13*200*7.45)+(13*322*8.25)/100) = 697.095
322=822-500
sumproduct-formula.xlsx
BCDEFG
15No Of UnitsRate Per Unit
160-10001.65
17101-3002004.10
18301-5002007.45
19500 + Above5008.25
20
21
22138224274400
Sheet4
Cell Formulas
RangeFormula
G22G22=\$B22*(SUMPRODUCT(C22*IF(E52:E55=0,100,((\$C22-LOOKUP(\$C22,E\$33:E\$36,E\$33:E\$36)*LOOKUP(C22,E\$33:E\$36,F\$33:F\$36)))/100)))
Press CTRL+SHIFT+ENTER to enter array formulas.

RapchikM

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

jasonb75

Well-known Member
There is data missing from your example that is used in the formula. Without that, we will not be able to help.

What is in E52:E55 ?
What is in E\$33:E\$36 and F\$33:F\$36 ?

RapchikM

New Member
There is data missing from your example that is used in the formula. Without that, we will not be able to help.

What is in E52:E55 ?
What is in E\$33:E\$36 and F\$33:F\$36 ?

My Apologies i was working bit hard in that range too. Sorry for the Blunder

Reposting the same with the Changes from
Kindly see the below in quotes and marked in Red
As criteria changed

How Can I use Sumproduct or Sum with IF(VlookUp or Lookup

You can see
The Cell range from D15:F19 is Fixed

From Row 22 onwards Formula will be draged.

So as per the fixed Range From D15:F19 the following is the result
=((13*100*1.65)+(13*200*4.1)+(13*200*7.45)+(13*500*8.25)/100) = 858
=(SUMPRODUCT(C58*IF(E52:E55=0,100,E\$52:E55)*F\$52:F\$55/100)) = 858

What i want here is in G22 = 677.095 because one condition of lookup or vlookup needs to be added

using below Formula
New formula in G22 =
=B22*(SUMPRODUCT(C\$22*IF(E\$16:E\$19=0,100,(LOOKUP(C\$22,E\$16:E\$19,E\$16:E\$19)*(C\$22-LOOKUP(C\$22,E\$16:E\$19,E\$16:E\$19)*LOOKUP(C22,E\$16:E\$19))))))

I am getting as 9724.26 instead of 66709.50 Somewhere i went wrong

The condition is to look for value C22 and on basis of that using SUMPRODUCT OR SUM with IF(Vlookup or Lookup
or How to achieve the following result with Sumproduct or Sum with Vlookup or Lookup and Cells blank or = 0 in the Range From D15:D19

=((13*100*1.65)+(13*200*4.1)+(13*200*7.45)+(13*322*8.25)/100) = 697.095
322=822-500
sumproduct-formula.xlsx
ABCDEFG
15No Of UnitsRate Per Unit
160-10001.65
17101-3002004.10
18301-5002007.45
19500 + Above5008.25
20
21
22138229724.26
Sheet4
Cell Formulas
RangeFormula
G22G22=\$B22*(SUMPRODUCT(\$C22*IF(E\$16:E\$19=0,100,((\$C22-LOOKUP(\$C22,E\$16:E\$19,E\$16:E\$19)*LOOKUP(\$C22,E\$16:E\$19,F\$16:F\$19)))/100)))
Press CTRL+SHIFT+ENTER to enter array formulas.

Last edited:

RapchikM

New Member
Please correct to the following which was earlier quoted in Red
=\$B22*(SUMPRODUCT(C\$22*IF(E\$16:E\$19=0,100,((C\$22-LOOKUP(C\$22,E\$16:E\$19,E\$16:E\$19)*LOOKUP(C\$22,E\$16:E\$19,F\$16:F\$19)))/100)))

jasonb75

Well-known Member

Book2
BCDEFG
15No Of UnitsRate Per UnitDiff
160-10001.651.65
17101-3001004.12.45
18301-5003007.453.35
19500 + Above5008.250.8
20
21
221382266709.5
Sheet2
Cell Formulas
RangeFormula
G16G16=F16
G17:G19G17=F17-F16
G22G22=SUMPRODUCT((C22>=\$E\$16:\$E\$19)*(C22-\$E\$16:\$E\$19)*\$G\$16:\$G\$19*B22)

RapchikM

New Member
JasonB

Your Column E does not match with my colum E and therefore i am getting as 67879.5 instead of 66709.05

RapchikM

New Member
From Begining only Column E was having values 0, 200, 200 and 500 as per post #1 and post#3 and older thread mentioned in post #1 also the values have not changed can kindly check Post #11 and Post# 15 of older thread.

jasonb75

Well-known Member
The way that you were trying to do it does not work, it will never work. I've suggested a method that will work. Looking at other posts will not change that.

The rate of 4.1 starts when you go over 100 units, which is why I've changed column E to 100.
The rate of 7.45 starts when you go over 300 units, which is why I've changed column E to 300.

jasonb75

Well-known Member
If you don't like different values in column E, then the simple fix for that is to keep your values there and use another column to feed the formula.
Book2
BCDEFGH
15No Of UnitsUseless columnRate Per UnitUseful columnRate difference
160-10001.6501.65
17101-3002004.11002.45
18301-5002007.453003.35
19500 + Above5008.255000.8
20
21
221382266709.5
Sheet2
Cell Formulas
RangeFormula
H16H16=F16
H17:H19H17=F17-F16
G22G22=SUMPRODUCT((C22>\$G\$16:\$G\$19)*(C22-\$G\$16:\$G\$19)*\$H\$16:\$H\$19*B22)

Replies
13
Views
218
Replies
2
Views
99
Replies
3
Views
189
Replies
5
Views
231
Replies
18
Views
294 Understanding data is crucial, and the easiest place to start is with Microsoft Excel.

Forum statistics

1,151,698
Messages
5,765,994
Members
425,322
Latest member
galaxy6623top 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.    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

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