Sum a column then multiply it depending on value of a cell

SandroUK

New Member
Joined
Dec 11, 2021
Messages
3
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi Guys,

I am working on something and I am a bit stuck, I am trying to sort this out without VBA as the file will be shared with other people that may not be savvy about any "warning" prompted from Excel with Macros.

I have the below example, so I need to sum the total of for example "Monday" column per the value matching A (which could be B) so in my head I came up with some stuff like this:

=SUMPRODUCT(B7:B18,SUMIF(B6,"A",B2),SUMIF(B6,"B",B3))

Which isn't working, I may thinker with VBA in case this is out of my reach with normal formulas, I am yet to explore arrays in formulas so not sure if with {} magic anything can be done :)

VBA tips is fine too if you have any quick ideas!

Thank you!

A
B
C
D
E
F
G
H
I
Menu A€ 20.00
Menu B€ 30.00
MondayTuesdayWednesdayThursdayFridaySaturdaySundayCover Offset
MenuabbaaabB
Jan
63​
52​
36​
124​
109​
97​
80​
10​
Feb
54​
71​
63​
30​
86​
125​
127​
0​
Mar
80​
30​
111​
80​
84​
63​
97​
0​
Apr
112​
33​
81​
120​
107​
102​
112​
50​
May
115​
42​
127​
96​
79​
76​
47​
0​
Jun
77​
64​
53​
89​
118​
127​
91​
0​
Jul
72​
115​
83​
68​
110​
42​
83​
0​
Aug
106​
81​
59​
78​
70​
126​
67​
60​
Sep
113​
61​
50​
53​
32​
53​
67​
0​
Oct
74​
34​
112​
47​
128​
72​
33​
0​
Nov
87​
102​
50​
60​
116​
68​
119​
0​
Dec
60​
112​
80​
64​
86​
39​
107​
100​
1013​
797​
905​
909​
1125​
990​
1030​
220​
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi & welcome to MrExcel.
Is this what you are after
+Fluff 1.xlsm
ABCDEFGHI
1
2Menu A€ 20.00Monday20260
3Menu B€ 30.00
4
5MondayTuesdayWednesdayThursdayFridaySaturdaySundayCover Offset
6MenuabbaaabB
7Jan635236124109978010
8Feb54716330861251270
9Mar8030111808463970
10Apr112338112010710211250
11May11542127967976470
12Jun77645389118127910
13Jul72115836811042830
14Aug106815978701266760
15Sep1136150533253670
16Oct74341124712872330
17Nov871025060116681190
18Dec6011280648639107100
19101379790590911259901030220
Main
Cell Formulas
RangeFormula
E2E2=SUMPRODUCT((B5:I5=D2)*(B7:I18))*IF(INDEX(B6:I6,MATCH(D2,B5:I5,0))="A",B2,B3)
B19:I19B19=SUM(B7:B18)
 
Upvote 0
Solution
Hi Fluff, I have used IFs after all!

I have done several full courses in 2020 / 2021 however having not used it all until now I feel like I have to cover most of them again, especially my two VBA courses!

Thank you for the reply!
 
Upvote 0
Glad you sorted it & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,545
Members
449,089
Latest member
davidcom

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