Indexing a sum of values by row from multiple columns - excel-formula

I'm struggling with this one...
http://postimg.org/image/50itqsz2x/
I've added a link to a screenshot, because I can't post images here...
In row 2 i have week numbers up to week 9 in this example. Row 1 has a formula that determines to which month a week belongs. In this example, week 5 is in month 1 and week 6 in month 2.
I need to sum the values by weeks and categories and show them in another table as monthly values as given in the example.

In B10 use this standard formula.
=SUMIFS(INDEX($B$3:$J$7,MATCH($A10,$A$3:$A$7, 0),),$B$1:$J$1,B$9)

Related

Calculation weekly quantities based on monthly data

I have been struggling to solve an issue to calculate monthly packages sales based on purchases during defined weekly time ranges. I have the following sample data:
Original Data :
The sales quantities are for two products A and B combined. A buyer X purchases 5 B packages on the first week of every month, another 4 on week 6 then 4 packages every 10 weeks.
I added the highlighted columns to the original table. I tried the following but the calculation I made in column E seems to be the sum of sales for B packages from the actual month until the end of the year rather than only for the current month. The formula I used in cell D2: '=(C2-6)/10', i.e. calculating how many 10-week ranges during the year after deducting 6 weeks. The formula I used in cell E2: '=5+4+4*D2', i.e. 5 is the initial quantity in week 1, 4 is the quantity in week 6 then 4 times the amount of 10-week ranges.
Calculation :
Is there a way, or a formula to calculate the monthly sales quantity for product B only?
I design from scracth the table to reflect the model I have understand:
Column D is for sales the first week of the month, column E is for sale on week 10 and column F is for sales every 10 weeks.
Formulas are spanish but are easy:
mes stands for month
si stands for if
residuo stands for residual
suma stands for add
It's quite complex and there are many many criterion when we try convert weekly sales in monthly sales. My criterion was every day of a week computes to the month of the Monday of that week.
I hope have met your requirements.

Excel Pivot table count between

I have a problem creating a pivot table/chart with between date function.
I would like to know the total count of projects that are active between two dates. A Chart with on the x-axis week 1 - week 52 is what i'm trying to create.
Example Chart
20
10
5
0
week 1 week 2 week 3 .....
My columns:
Project ID | START WEEK NUMBER| END WEEK NUMBER
What have I already done?
Adding helper columns 1 till 52 with the following function:
=IF(AH$1=MEDIAN($AB10;$AD10);1;IF(AH$1=$AB10;1;IF(AH$1=$AD10;1;"")))
This will show a 1 when the column week header is equal or between date start week and end week. But with this I am still not able to create a chart with the weeks on the x-axis and the total count of that week.
Make a new sheet and in Column A put your weeks 1-52 down. In column B use this formula:
=COUNTIFS(Sheet6!$B$2:$B$18,"<="&A2,Sheet6!$C$2:$C$18,">="&A2)
Sheet6! Needs to be replaced with the name of your Sheet, e.g. Projects!
Column B range needs to be the entire range of your start week
Column C range needs to be the entire range of your end week
B and C dimensions need to match.
If you need to use a pivot table, try rearranging your source data as shown:

how to get cumulative amount of columns under certain criteria when skipping some of them

I have a question with regards to getting the cumulative amount of some columns when skipping others (please see the picture).
Lets say on a certain row we have certain type of op units for which we have 3 columns for every month (Revenue, COS, G&A). We have this for Jan, Feb, March and then 3 columns to total the amounts for quarter 1. The next 3 columns are for April.
My question is how to make formulas that can add the cumulative amount for year to date in each category while skipping the Q1 amounts. I can do with offset but I can't skip Q1 column.
You need a SUMIFS formulas that sum amounts in columns B:P for each category but exclude amounts where B1:P1 = "q1". So for YTD Revenue the formula would be:
=SUMIFS($B$3:$P$3,$B$2:$P$2,Q$2,$B$1:$P$1,"<>q1")
Copy to the right into columns R:S and then down rows as required.
Sorry, I don't think that offset /sumif will work because of 3 different criteria.
Otherwise the month I will be selecting in row 1 after end of the table (after Dec17 and Q4) there will be 3 foxed columns that will show YTD cumulative figure which should change when the month changes

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)
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.

How to collect number of days from a month in excel

I have a column which will have some days from a month in dd-mm-yyyy format. What I need to get total number of days from each month mentioned in that column. The column might not contain all days from each month.
Example :
Column A :
2017-01-01
2017-01-02
2017-01-17
2017-01-27
2017-02-08
In above example, from 2017 Jan, I have 4 days and from Feb I have one day. I need this count for a IF statement to run in C column. ie, in C1 there will be an IF function which will check the month in A1 and count the total number of days for that specific month from A column. If that count is below a specific digit, I need to perform a formula otherwise a different one. This will repeat for all C cell
If this column contains all date from each month I can use Day function to get total days, but here how Can I collect it
This will work: =SUMPRODUCT(1*(MONTH($A1:$A5)=D1))
And an example of manipulating basing on the result:
=IF(SUMPRODUCT(1*(MONTH($A1:$A5)=D1))<3;"good";"bad")
Another one when row number represents a month (JAN in C1, FEB in C2...):
=IF(SUMPRODUCT(1*(MONTH($A1:$A5)=ROW()))<3;"good";"bad")
In your case:
=IF(SUMPRODUCT(1*(MONTH($A1:$A5)=ROW()))<10;function1();function2())
Array formula - use Ctrl+Shift+Enter:
=SUM((MONTH($A$1:$A$5)=MONTH(A1))*(YEAR($A$1:$A$5)=YEAR(A1)))

Resources