Andyww
Andyww

Reputation: 219

Conditional Sum (based on current week)

I have an excel 2010 Workbook. Within this there are two columns.

The first column represents numerical week 1 (1-52 rows), the second contains a numeric value (never blank)

I would like a formula which basically sums all the rows (2nd column) up until the current week. So today it would sum the rows 1 through 11, next week it would sum 1 through 12

Tried a SUMIF but could not get it working (always zero)

Upvotes: 0

Views: 981

Answers (1)

Jordan
Jordan

Reputation: 4514

Try this:

=SUMIF(A1:A52,"<="&WEEKNUM(TODAY(),2),B1:B52)

Where your week numbers run from A1:A52 and your values run from B1:B52.

You can also define which day the week begins on within the WEEKNUM() function by changing the second parameter. It is currently set to 2 which is based on the week beginning on Monday.

Upvotes: 2

Related Questions