Adding new criteria to my formula - excel

I have formula from that, I am getting output, now I wanted to add one more criteria,
=SUM(SUMIF('Data '!$C$2:$C$410,IF(H7=Translation!$A$2:$A$27,Translation!$C$2:$C$27),'Data '!$J$2:$J$410)*COUNTIF(H7,Translation!$A$2:$A$27)*Translation!$E$2:$E$27)
I wanted to show only last 30 days data, date is in Data sheet column number I.
Any suggestion would be great.

To do that you can change the SUMIF to a SUMIFS function and include the date criteria within that SUMIFS, i.e. with dates in column I this will only cover the last 30 days including today
=SUM(SUMIFS('Data '!$J$2:$J$410,'Data '!$C$2:$C$410,IF(H7=Translation!$A$2:$A$27,Translation!$C$2:$C$27),'Data '!$I$2:$I$410,">"&TODAY()-30,'Data '!$I$2:$I$410,"<="&TODAY())*COUNTIF(H7,Translation!$A$2:$A$27)*Translation!$E$2:$E$27)
confirmed with CTRL+SHIFT+ENTER as before
SUMIFS requires Excel 2007 or later

Related

Formula for SUMing certain months but disregard blank cells

I'm trying to total sales amount in a column for a certain month. The column with the dates will include blank cells.
I got this code to work once but when I try to change the sheet it references it just comes up with $0.
=IF(ISBLANK(eBay!$A$2:$A$3000),0,(SUMPRODUCT((MONTH(eBay!$A$2:$A$3000)=1)*eBay!$H$2:$H$3000)))
Where the Month Column is eBay!A2:A3000 and the sales column is eBay!H2:H3000.
I've also tried:
=SUMIFS:(eBay!H2:H3000, eBay!A2:A3000, (MONTH(eBay!A2:A3000)=1, eBay!A2:A3000, "<>")
I tried the Evaluate Formula for the first formula and it comes up as TRUE for ISBLANK when there are two cells with dates in them.
The second formula says the MONTH is 4 when there is a Month for January. So I changed the date from 1 to 4 and it didn't total for April either.
I thought either one of these formulas would work. What can I try next?

Excel using COUNTIFS Function to create a Punchcard

In my data source I have a column that contains the Dates of occurrences and a Column that contains the Hour of the same occurrences.
With this, the goal is to obtain a punchcard plot (maybe the bubble chart will be the most appropriate)
The intermediate structure has the weekday(Sunday-Saturday) as rows (A2:A8), and the hours (8-22) as Columns (B1:P1), as each column must have the occurrence count for a week day in an hour.
With this said, I tried to use the COUNTIFS function, using the following approach, for the cell B2:
=COUNTIFS(WEEKDAY(RawData!T2:T9852;1);A2;HOUR(RawData!U2:U9852);B1)
However, Excel is not computing the value, finding a problem on the formula, having also tried using the Insert Formula Option.
place the following in B2
=SUMPRODUCT((WEEKDAY($T$2:$T$8,1)=WEEKDAY($A2,1))*(HOUR($U$2:$U$8)=HOUR(B$1)))
you will need to convert the , to match the ; on your system
In your range A2:A8 enter a known date for monday such as 2017/08/20. Then select A2:A8 and apply custom formatting for the number format and set it to ddd. This will display the day of the week in text but keep the value in the cell a number.
Adjust the ranges to suit your data.
Copy the formula to fill in your table.

Lookup date, return sum of previous 5 days

I am needing a bit of help on a formula which I have been amending for a while now with no success going through vlookups, indexmatches, sumproducts etc.
Basically, on one tab "weekly summary" I have the date contained in cell H2 which will only ever be set to a monday. I need a formula in cell B3 that will look up to a different tab "Raw Data Input" based on this date in cell H2, and return the sum of the values for the previous week (previous 5 amounts using the workdays formula on raw data input tab).
So for instance if this was today, 14th Nov, I would want the sum of the values from 7th-11th Nov.
Is this possible without doing 5 separate vlookups to different dates?
Ps. I will eventually form this into a macro, however as I have a number of tasks to complete before I get to that stage, I would prefer it as a formula, to get everything set up before I start adding VBA.
You can use SUMIFS where your multiple conditions are dates are less than 14th Nov, but greater than 14th Nov - 7
=SUMIFS(A:A,B:B, "<"&$H$2,B:B, ">"&$H$2-7)
Whereby A:A is the sum range, and B:B is the columns with dates.

How can I find number of entries of a particular type within a given time period in Excel? [duplicate]

As the title states, I am trying to count across cell ranges on a separate sheet but cant seem to get it to work. Any help would be greatly appreciated.
=COUNTIFS(MONTH(original!A2:A58),"1",original!D2:D58,"=East")
The issue is the Month() part in your formula. I understand your logic, but you'll have to probably add a new column on the Original sheet that has the month formula conversion there, then update the countif to reference it.
COUNTIFS(Original!monthcol, "1", Original!col, "East")
Again, in summary the Month formula can't do the conversion for an entire range of cells in the CountIf. The only other way would require an array formula. Hope this helps.
You cannot use the MONTH function as a form of sub-function in a COUNTIFS function. You need to add an extra level of calculation with something like a SUMPRODUCT function.
=SUMPRODUCT((MONTH(original!A2:A58)=1)*(original!D2:D58="East"))
That should count the instances where the month of the date in the Original worksheet's column A is January and the corresponding row's column D is East.
If you prefer to stay with a COUNTIFS and can keep the dates to a single year, you can provide a start date and end date which will bracket the month of January for a particular year.
=COUNTIFS(Original!A2:A58,">="&DATE(2015,1,1),Original!A2:A58,"<"&DATE(2015,2,1),Original!D2:D58,"East")
The default comparison operator for COUNTIFS is equals. There is no need to type it in.

Attempting to count cells in Excel using multiple criteria

As the title states, I am trying to count across cell ranges on a separate sheet but cant seem to get it to work. Any help would be greatly appreciated.
=COUNTIFS(MONTH(original!A2:A58),"1",original!D2:D58,"=East")
The issue is the Month() part in your formula. I understand your logic, but you'll have to probably add a new column on the Original sheet that has the month formula conversion there, then update the countif to reference it.
COUNTIFS(Original!monthcol, "1", Original!col, "East")
Again, in summary the Month formula can't do the conversion for an entire range of cells in the CountIf. The only other way would require an array formula. Hope this helps.
You cannot use the MONTH function as a form of sub-function in a COUNTIFS function. You need to add an extra level of calculation with something like a SUMPRODUCT function.
=SUMPRODUCT((MONTH(original!A2:A58)=1)*(original!D2:D58="East"))
That should count the instances where the month of the date in the Original worksheet's column A is January and the corresponding row's column D is East.
If you prefer to stay with a COUNTIFS and can keep the dates to a single year, you can provide a start date and end date which will bracket the month of January for a particular year.
=COUNTIFS(Original!A2:A58,">="&DATE(2015,1,1),Original!A2:A58,"<"&DATE(2015,2,1),Original!D2:D58,"East")
The default comparison operator for COUNTIFS is equals. There is no need to type it in.

Resources