1 st column date and 2nd column amount 3rd column date and 4th column amount .. is going on.
I want to sum based on date, If date between 2019 to 2020, i need sum the amount.
I was able to get the function SUMPRODUCT to work, assuming I understand what you want to do. (I think you want a billings total for each year, is that right?)
See this ExcelJet article on SUMPRODUCT.
There's probably a way to make this even shorter, but here's one solution:
See screen clip (I'm not allowed to post images yet.)
Formula for cell C6: =SUMPRODUCT(--(YEAR(B$3:B$4)=2019),C$3:C$4)
Copy that into cells E6, G6, I6, K6, and M6. The column references will adjust.
This will give you the 2019 totals for each of the 6 periods in row 6.
Formula for cell C7: =SUMPRODUCT(--(YEAR(B$3:B$4)=2020),C$3:C$4)
Copy that into cells E7, G7, I7, K7, and M7. The column references will adjust.
This will give you the 2020 totals for each of the 6 periods in row 7.
Formula for cell N6: =SUM(B6:M6). This is the 2019 total (the sum of row 6).
Formula for cell N7: =SUM(B7:M7). This is the 2020 total (the sum of row 7).
Related
I have a sample data like this:
I want to insert number 1 in 'Identifier' column every 12 weeks BUT counting these weeks from every value equal to 1 in 'Flag' column. So if a the value is 1 in 'Flag' column on 26.1.2021 then we count 12 weeks from there and insert 1 in 'Identifier' column (week 20.4.2021), and so on.. Any formula that can do the job?
You could just write =B2 in cell C14 and drag down.
A bit more sophisticated, starting in D2:
=IF(ROW()>ROW(A$1)+12,INDEX(B:B,ROW()-12),0)
and drag down
or in Excel 365 you could use a spill formula:
=IF(ROW(A2:A28)>ROW(A1)+12,INDEX(B:B,ROW(A2:A28)-12),0)
always assuming your dates in the first column are going up in regular steps of one week.
I have an array list in column A (starting in A2) using:
{=IFERROR(INDEX(MonthSpend,MATCH(0,COUNTIF($A$1,A1,MonthSpend),0)),""}`
Where MonthSpend is a named range from a table on a separate sheet.
I have copied the formula down to A300, but inserted blanks in a number of rows.
From the picture you will see that I have each month showing up only on every 6th row. The formula in A8 is:
{=IFERROR(INDEX(MonthSpend,MATCH(0,COUNTIF($A$1:A2,MonthSpend),0)),"")}
and in A3:A7 there is nothing).
I named this range in column A MonthAcc.
In column B (starting in B2), I tried using:
=IF(MonthAcc>10,INDEX(MonthAcc,COUNTA(MonthAcc)+ROW(MonthAcc)-ROW(),1),"")
to reverse this list.
This didn't work because the reversal function in B2 references a row near the bottom of the MonthAcc list, which is blank.
I'm trying to get it so that in B2 (in the picture below) it would have January 1, 2020 and then in B8 it would have December 1, 2019 and then in B14 it would have November 1, 2019 and so on.
The list MonthSpend is dynamic so can be totally different lengths.
How do I reverse my dates but keep it starting at the top and only every 6th row?
In the second picture you will see a column called Month. It uses the function =IF(E3="","",DATE(YEAR(C3),MONTH(C3),1)) starting in F3 and copied down the entire table. This is the named range MonthSpend. It is dynamic in that for a different project, you could have dates ranging from April 2017 to January 2020 etc. So the months that show up in the Month column, are what I want in my new reversed list, spaced 6 rows apart.
With the column Week ending you can use the following formula:
=IF((MOD(ROW()+4,6)=0),LOOKUP(2,1/(COUNTIF(C$1:$C1,$A$2:$A$25-DAY($A$2:$A$25)+1)=0),$A$2:$A$25-DAY($A$2:$A$25)+1),"")
It returns distinct dates from list converted to first day of month (you can also convert to other formats using the appropriate functions.) in reverse order every sixth row. Dates must be sorted in source column in ascending order. BUT! For empty cells it returns first day of XX century, so I enter that date manually to C2, if it bothers, it can be hidden
I am trying to calculate the difference between total current quarter and total previous quarter in Excel. The data is at the row title and the quarter month is not standard. For example January is consider as quarter 4 and February is quarter 1. Also date can change from one report to the next.
This is the sample data:
I want to add a formula in column H that total all amount in Q4 (Nov-Jan) and in column I the total amount in Q1 (Aug-Oct) for every row. Next month report column G will be February and I need a formula that dynamic enough to know the current quarter amount to be placed in column H.
I was thinking about using sumproduct and choose but Excel does not like it:
=Sumproduct(--((CHOOSE(MONTH(B29:G29),4,1,1,1,2,2,2,3,3,3,4,4)=4),B30:C30))
If this formula can work, I can just copy paste it to the remaining row in column H and I.
Based on above example use:
=SUMPRODUCT(--(1+MOD(INT((MONTH($B$29:$G$29)-2)/3),4)=RIGHT(H$29,1)*1),$B30:$G30)
With this array formula at H30 would do what you want and you can copy paste in I30 and in the rows down. It will work also if you add columns for Q2 and Q3.
H30 -->
=SUM(IF(CHOOSE(MONTH($B$29:$G$29),4,1,1,1,2,2,2,3,3,3,4,4)=INT(RIGHT(H$29,1)),$B30:$G30))
Ctrl+Shift+Enter
Notice it takes the quartile's number from the row above, it fixes the columns and parametrizes with the row.
I have an Excel book with around 100 spreadsheets within the book. Each spreadsheet is an application of certain products. The very last spreadsheet is a total tally for the year for each product we use. The SUMIF formula I am using is:
=SUMIF('Jan 1:Dec 31'!B5:B14,"Name of product",'Jan 1:Dec 31'!D5:D14)
So when the Name of the product is used in B5:B14 in all spreadsheets from first (Jan 1) to last (Dec 31) I want to sum its value from the D5:D14 cells in all spreadsheets from first (Jan 1) to last (Dec 31).
The problem is that I just end up getting a #VALUE error. I have also tried inputting the formula by holding Ctrl+Shift. Nothing seems to work.
You could use the indirect formula and have Jan 1 in cell A1, and then in B1 have formula:
= sumif(indirect(A1&"!B5:B14"),"Name of product",indirect(A1&"!D5:D14"))
Then you'd put Jan 2 in cell B1 and copy the sumif formula down.
Note that this assumes structure is consistent on each tab and that number of rows is consistent on each tab as well (or you can make the bottom of the range an arbitrarily high number like row 50,000)
Hello Everyone,
Does anyone know how to sum the Hours from column B (Hours) if column A numbers matched with column E and sum by months.
Example, take February data as an example, since only 3000 & 4000 existed in both column A & column E, that's why I need to sum the hours (20+10=30) from column B by it's month below.
I also attached the example excel sheet below.
https://www.dropbox.com/s/0s51g1i8g6s6e2d/Test.xls?m
Thanks in advance. :-)
You could get complicated with customer functions but if having an extra column (potentially hidden) doesn't matter then this would work:
In cell D2 enter:
=iferror(vlookup($A2,$E$2:$E$20,1,FALSE),"x")
Drag the formula down.
Under each month you can then put:
=sumifs($B$2:$B$16,$C$2:$C$16,B$22,$D$2:$D$16,"<>x")
Drag the formula across
This assumes you can change the month format in either column C or row 22 to be the same, ie. Jan, Feb, Mar or January, February, March etc.
Written on the fly and not tested so excuse any minor errors...
Both answers posted thus far are just fine, but just as an alternative, here's what I would do. Put this formula in cell D2 and drag it down:
=IF(NOT(ISNA(VLOOKUP(A2, $E$2:$E$20, 1, FALSE))), B2, "")
Then if you make a column containing the names of the months, say from G2 to G7 you have February, March, ..., July, you can put this formula into H2 and drag it down:
=SUMIFS($D$2:$D$16, $C$2:$C$16, G2)
That should get what you want.
Put this formula in Cell D2 and drag down:
=IF(NOT(ISERROR(MATCH(A2,$E$2:$E$20,FALSE))),B2,"")
In row 22, change the month names to be the full name, OR in column C, change the month names to abbreviated 3-letter names, this is so we can make use of the SumIf function.
Then, in Cell B23, put this formula and drag it across:
=SUMIF($C$2:$C$16,B22,$D$2:$D$16)
(I put the formula in row 24 to check against the data you already had in Row 23)
Shouldn't be much harder without a helper column. Just make sure you have full month name in row 22 to match column C data then use this formula in B23 copied across
=SUMPRODUCT(SUMIFS($B2:$B16,$C2:$C16,B22,$A2:$A16,$E2:$E20))