weighted sumif not working as expected

Mr2017

Well-known Member
Joined
Nov 28, 2016
Messages
644
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi

I've got a formula that's not working, as expected.

Please find below a very simple sample of the data and formulae I've used:

If you copy and paste the data below, it should go from cell A1:H7.

I'd like to use a sumif to do two things

1) get the weight of the "Promo sales" for each product based on the "Department" they're in ie Food or GM AND whether they're on Deal, which I've done correctly using this formula (this was in cell G2 then dragged down): =IF(F2="Not on Deal","",D2/SUMIF(A:A,A2,D:D))

2) get the weight of the "Uplift" for a product in the "Food" department, but only for products that are "On Deal" in column H. I used this formula (in cell H2 and dragged it down), but it didn't work!? =IF(F2="Not on Deal","",IF(E2<0,"",E2/SUMIF(A:A,A2,E:E))) Does anyone know how I should amend it, please?


[TABLE="width: 634"]
<colgroup><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD][TABLE="width: 634"]
<colgroup><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Department[/TD]
[TD]Product[/TD]
[TD]Base Sales[/TD]
[TD]Promo Sales[/TD]
[TD]Uplift[/TD]
[TD]On Deal? [/TD]
[TD]Weighted PROMO sales[/TD]
[TD]Weighted UPLIFT sales[/TD]
[/TR]
[TR]
[TD]Food[/TD]
[TD]Chocolate[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]3000[/TD]
[TD="align: right"]1000[/TD]
[TD]On Deal[/TD]
[TD="align: right"]75%[/TD]
[TD="align: right"]111%[/TD]
[/TR]
[TR]
[TD]Food[/TD]
[TD]Chicken[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD]On Deal[/TD]
[TD="align: right"]0%[/TD]
[TD="align: right"]0%[/TD]
[/TR]
[TR]
[TD]Food[/TD]
[TD]Cheese[/TD]
[TD="align: right"]500[/TD]
[TD="align: right"]300[/TD]
[TD="align: right"]-200[/TD]
[TD]On Deal[/TD]
[TD="align: right"]8%[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Food[/TD]
[TD]Milk[/TD]
[TD="align: right"]600[/TD]
[TD="align: right"]700[/TD]
[TD="align: right"]100[/TD]
[TD]On Deal[/TD]
[TD="align: right"]18%[/TD]
[TD="align: right"]11%[/TD]
[/TR]
[TR]
[TD]GM[/TD]
[TD]Sunglasses[/TD]
[TD="align: right"]500[/TD]
[TD="align: right"]500[/TD]
[TD="align: right"]0[/TD]
[TD]Not On Deal[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]GM[/TD]
[TD]Skateboards[/TD]
[TD="align: right"]500[/TD]
[TD="align: right"]500[/TD]
[TD="align: right"]0[/TD]
[TD]Not On Deal[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Maybe? Your SUMIF is including the -200 in cell E4. Try using a SUMIFS function as below.
Excel Workbook
ABCDEFGH
1DepartmentProductBase SalesPromo SalesUpliftOn Deal?Weighted PROMO salesWeighted UPLIFT sales
2FoodChocolate200030001000On Deal0.7590.91%
3FoodChicken000On Deal00.00%
4FoodCheese500300-200On Deal0.075
5FoodMilk600700100On Deal0.1759.09%
6GMSunglasses5005000Not On Deal
7GMSkateboards5005000Not On Deal
Sheet
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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