conditional sum across columns

JV0710

Active Member
Joined
Oct 26, 2006
Messages
440
Office Version
  1. 365
  2. 2016
  3. 2013
Platform
  1. Windows
Hi

Please can I get some help with a formula for this query:

On my Sheet I have in Row3 ( from A3 ), headings for months and weeks - so in A3 I have "January" and in B3 I have - week1, in c3 - week2, . . . in f3 - February, g3 -week1 etc

I row 4, I have values in the week columns adding up the month columns.

In A1 I have a number = 8

see example:
Book1
ABCDEFGHIJKLM
18
2
3JanuarywwwwFebruarywwwwMarchww
440101010104010101010501010
Sheet1


I B6 I want to sum the next 8 ( value in A1 ) weeks data from C6

something like Sumproduct(--(left(C3:dd3)="w")*(c4:dd4)) but only for the next 8 instances of "weeks"

If the value in A1 changes to 5 the it must sum the next 5 weeks data etc

I hope that makes sense

Thank you

JVN
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi Guys

=SUMIF(B3:OFFSET(B3,0,A1-1),"w",B4:OFFSET(B4,0,A1-1))

This does not work if the range stretches over 2 months

And the summing has to begin from column c if I am in column B

Thanks

JVN
 
Upvote 0
Hi Guys

=SUMIF(B3:OFFSET(B3,0,A1-1),"w",B4:OFFSET(B4,0,A1-1))

This does not work if the range stretches over 2 months

And the summing has to begin from column c if I am in column B

Thanks

JVN
Try the formula I suggested.

Not sure what you mean by: "if I am in column B".

You just have to adjust the ranges to fit your needs.
 
Upvote 0
Thank you T Valko

Your Answer works fine

What I meant by "If I am in column B" ??
I will copy the formula across to c6,d6, etc

Thank you very much for your help

StuLux: I will also add in the enhancements to make sure that at month level there is no value etc

Thank you once again
 
Upvote 0
Thank you T Valko

Your Answer works fine

What I meant by "If I am in column B" ??
I will copy the formula across to c6,d6, etc

Thank you very much for your help

StuLux: I will also add in the enhancements to make sure that at month level there is no value etc

Thank you once again
Good deal. Thanks for the feedback! :cool:
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,862
Members
452,948
Latest member
UsmanAli786

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