Count date field that occurs in a specific month - excel

I need to count the occurrence of a specified month in my data, I used the following formula
=SUMPRODUCT((MONTH(E$2:E$9999)=2)*(YEAR(E$2:E$9999)=2011)*1)
The formula works, but XCelsius do not recognize the SUMPRODUCT function
This is my data sample
2011/02/14 08:54:21 AM
2011/02/18 11:08:57 AM
2011/02/21 10:40:55 AM
2011/04/13 09:48:46 AM
2011/04/14 09:03:58 AM
2011/05/25 06:20:29 AM
Is there another way of counting the occurrences of a specified month

Maybe try this:
=COUNTIF(E$2:E$9999,">=2011-02-01")-COUNTIF(E$2:E$9999,">=2011-03-01")

Related

How to do index match on more than 1 conditions in Excel?

I have the following where I want to return the value of a search based on the month, however, there could be repeated month numbers in different years.
For example:
My current index match formula is:
=INDEX($E$8:$E$22,MATCH(I$2,$C$8:$C$22,0))
Please advise if it is possible to return the GMV of a particular month in a given year using index match (i.e. setting >1 conditions), thanks a lot!
IF you have Office365 then XLOOKUP() can search from last to first.
=XLOOKUP(I2,C8:C13,E8:E13,"",0,-1)
Here [search_mode] parameter -1 indicates to search from last to first. If you don't have Excel365 then you have to provide both year and month to match exact month for the year.
If you always search for current year's month then use Match() function like-
=INDEX(E8:E13,MATCH(YEAR(TODAY())&I2,B8:B13&C8:C13,0))
You may need to enter the formula as array entry with CTRL+SHIFT+ENTER.
I suggest the next steps to be done in the following order:
Change cells C2:E3 and G3:I3 to be Oct-2020, Nov-2020 ....
Change the formula in Row no. 3 to :
=INDEX($E$8:$E$22,MATCH(C$2,$D$8:$D$22,0))
Make sure that Row no.2 values match values below "Date" title in D column

How to filter out partial match in an Excel row?

I have an Excel sheet with dates in the rows. A given month should be used only once in a row. How can I filter out, if there are two dates in the same row from the same month?
For example I have the following array, and I would like to have as a result, that there is a match in this row (2012-03).
2012-03-04 2012-02-05 2012-04-06 2012-03-07 2012-10-08 2012-11-09 2012-12-10
I have tried to combine aggregate and match functions, but I cannot find out how to do it properly.
One of my codes, of course it gave an error:
=aggregate(9,6,(MATCH("*"&LEFT(A8,7)&"*","*"&LEFT(b8,7)&"*",0), MATCH("*"&LEFT(b8,7)&"*","*"&LEFT(c8,7)&"*",0)))
Ok, now I have tried another way, and I could get a solution, but with a code which is like a km long...I have first created a new dataset, cutting down the days by using: =""&LEFT(A8,7)&""
Then I have compared all the cells in a given row of my new dataset. Could someone help me how to shorten the exact( ) parts? The aim is to compare all.
=if((or(exact(A2, B2), exact(A2,C2),exact(A2,D2),exact(A2,E2),exact(A2,F2),exact(A2,G2),exact(A2,H2),exact(A2,I2),exact(A2,J2),exact(A2,K2),exact(A2,L2),exact(A2,M2),exact(A2,N2),exact(A2,O2),exact(A2,P2),exact(A2,Q2),exact(A2,R2),exact(B2,C2),exact(B2,D2),exact(B2,E2),exact(B2,F2),exact(B2,G2),exact(B2,H2),exact(B2,I2),exact(B2,J2),exact(B2,K2),exact(B2,L2),exact(B2,M2),exact(B2,N2),exact(B2,O2),exact(B2,P2),exact(B2,Q2),exact(B2,R2),exact(C2,D2),exact(C2,E2),exact(C2,F2),exact(C2,G2),exact(C2,H2),exact(C2,I2),exact(C2,J2),exact(C2,K2),exact(C2,K2),exact(C2,L2),exact(C2,M2),exact(C2,N2),exact(C2,O2),exact(C2,P2),exact(C2,Q2),exact(C2,R2),exact(D2,E2),exact(D2,F2),exact(D2,G2),exact(D2,H2),exact(D2,I2),exact(D2,J2),exact(D2,K2),exact(D2,L2),exact(D2,M2),exact(D2,N2),exact(D2,O2),exact(D2,P2),exact(D2,Q2),exact(D2,R2),exact(E2,F2),exact(E2,G2),exact(E2,H2),exact(E2,I2),exact(E2,J2),exact(E2,K2),exact(E2,L2),exact(E2,M2),exact(E2,N2),exact(E2,O2),exact(E2,P2),exact(E2,Q2),exact(E2,R2),exact(F2,G2),exact(F2,H2),exact(F2,I2),exact(F2,J2),exact(F2,K2),exact(F2,L2),exact(F2,M2),exact(F2,N2),exact(F2,O2),exact(F2,P2),exact(F2,Q2),exact(F2,R2),exact(G2,H2),exact(G2,I2),exact(G2,J2),exact(G2,K2),exact(G2,L2),exact(G2,M2),exact(G2,N2),exact(G2,O2),exact(G2,P2),exact(G2,Q2),exact(G2,R2),exact(H2,I2),exact(H2,J2),exact(H2,K2),exact(H2,L2),exact(H2,M2),exact(H2,N2),exact(H2,O2),exact(H2,P2),exact(H2,Q2),exact(H2,R2),exact(I2,J2),exact(I2,K2),exact(I2,L2),exact(I2,M2),exact(I2,N2),exact(I2,O2),exact(I2,P2),exact(I2,Q2),exact(I2,R2),exact(J2,K2),exact(J2,L2),exact(J2,M2),exact(J2,N2),exact(J2,O2),exact(J2,P2),exact(J2,Q2),exact(J2,R2),exact(K2,L2),exact(K2,M2),exact(K2,N2),exact(K2,O2),exact(K2,P2),exact(K2,Q2),exact(K2,R2),exact(L2,M2),exact(L2,N2),exact(L2,O2),exact(L2,P2),exact(L2,Q2),exact(L2,R2),exact(M2,N2),exact(M2,O2),exact(M2,P2),exact(M2,Q2),exact(M2,R2),exact(N2,O2),exact(N2,P2),exact(N2,Q2),exact(N2,R2),exact(O2,P2),exact(O2,Q2),exact(O2,R2),exact(P2,Q2),exact(P2,R2),exact(Q2,R2))),"same month","ok")
Thank you in advance.
I am not sure if there is a better way, but this is how I'd tackle the problem based on my Excel knowledge:
Add data of dates above in cells A1-G1
On row below date add formulas for dates: A2=DATE(A1) ..... G2=DATE(G1)
At the end of the original row of dates add the numbers 1 thru 12:
using formula cell H1=1, I1=H1+1 ..... S1=R1+1
After the months on row 2:H2=COUNTIF($A2:$G2,H1) ..... S2=COUNTIF($A2:$G2,S1)Counting frequency for each of the 12 months
T2=MAX(H2:S2)
Then select on cell T2being more than 1.
Here it is as a Google sheet (you can download it and open in Excel if you want)
Maybe this will help. Assume that the range of dates is in $A$1:$G$1. Also assume that the entries are numerical dates; if they are instead text you can handle this by using the DATEVALUE function. Then we can get the years and months of the range with:
{=YEAR($A$1:$G$1)}
{=MONTH($A$1:$G$1))
This and all other formulas must be entered as array formulas (CrtlShiftEnter).
We next convert back to a date, but use 1 for the day, so that all dates get shifted to the first day of the month (this means that any dates from the same month are shifted to the same date):
{=DATE(YEARS,MONTHS,1)}
We can produce an NxN comparison of the shifted dates by:
{=TRANSPOSE(SHIFTED_DATES)=SHIFTED_DATES}
We can count the number of True's in this array by:
{=SUM(--(ARRAY))}
If there we no dates from the same month we'd expect this to sum to N because this method compare each date to itself as well as the other dates. The causes the N elements on the main diagonal of this array to be True. If any dates are in the same month off-diagonal elements will also be True. So to detect if there are dates from the same month we make the comparison:
{=SUM(--(ARRAY)) > N}
or more generally:
{=SUM(--(ARRAY)) > COUNT($A$1:$G$1)}
Rolling all of these up into one formula:
=IF(SUM(--(TRANSPOSE(DATE(YEAR($A$1:$G$1),MONTH($A$1:$G$1),1))=DATE(YEAR($A$1:$G$1),MONTH($A$1:$G$1),1)))>COUNT(DATE(YEAR($A$1:$G$1),MONTH($A$1:$G$1),1)),"same month","ok")
If your dates are in a range other than $A$1:$G$1 then make the appropriate substitutions.
Hope that helps.

Excel Formula to Calculate Text within a date range

I am trying to calculate values within a specific date range. The data I want to split between each month and the values: Successful, Incomplete and Failed.
I've tried pivot tables with this data but it doesn't work for me, also lacking pivot table excel experience. Formulas I'm more comfortable with.
I am using the following statement to at least get the total number of a value I add into it;
=COUNTIF('Jan 19'!$C$2:$C$1159,"Value")
Ex. If I put into the value "Successful" I get the total number of successful records.
I am looking into having a formula that I can input a specific month/date range (Jan, Feb, etc) and a value to get a count.
Ex. =Formula ((RangeOfData, "Value") AND (RangeOfData, (FromDate, ToDate))
I expect to the get the total number of a value(s) within a specific date range. If there isn't any data then the results would be blank or 0.
I'd use the formula COUNTIFS() as #cybernetic.nomad pointed in the comments so you can put more conditions on the COUNT:
=+COUNTIFS('Jan 19'!$B$2:$B$1159,">="&F3,'Jan 19'!$B$2:$B$1159,"<"&G3,'Jan 19'!$C$2:$C$1159,H3)
In the formula above I guessed the dates are in the COLUMN B, if not, you need to change it in the formula above.
To do that we should put the range we want to look at in a couple of cells where you would put the date range, in the example above:
F3 is the start date (if you want February of this year should be 1/2/2019).
G3 is the final date (if you want February of this year should be 1/3/2019).
H3 is where you can write "value", "successful" or any other string you are trying to count.

Excel Return Date before another date by another column name

I have two sheets of data with the following.
I want return the date from sheet 2 on sheet 1 with the start date BEFORE the remove date. For example. For Customer A, the remove date is 12/29/2016. I would want to return the date of 12/20/2014 from sheet 2 as it is the next previous date from the remove date of 12/29/2016 from sheet 1 and is removed prior to the third date of 1/20/2017. Similarly for Customer B, the date returned would be 11/9/2013.
Vlookup will not work as there are more than one unique value for customer and I had no luck with index and match. Is there any other possible solution?
Here is an edit. The Sumproduct and aggregate method for the start date works great. The issue is I need the last date to be the first record after the replacement date. So in this case, it would be 2/1/16. Using the Min or Max sumproduct and aggregate method, I get either 0 or the max date of 3/22/17, which is not what I want.
Since dates are (for all intents and purposes) numbers, this is really nothing more than a pseudo-MAXIFS question. Try,
=aggregate(14, 6, (b2:b7)/((a2:a7="A")*(b2:B7<date(2016, 12, 29))), 1)
For those that don't have the latest version of excel and can't use maxifs, we can do an array formula: take the max date that is less than the date corresponding to A
=SUMPRODUCT(MAX((A9:A14=A3)*(IF((B9:B14)<B3,B9:B14))))
entered as array formulae (Ctrl+Shift+Enter)

sumif of current date and time with indirect Match

How do I modify the following to include to look a the current time and compare to named range.
=SUMIF(3:3,TODAY(),INDIRECT("a"&MATCH("total",A:A,0)):INDIRECT("z"&MATCH("total",A:A,0)))
I need determine the sum of values where column A value = "workingProgresssubtotal" and row 4(time)is <= current time for current date.
return sum(workingProgressSubtotal)
also repeat process the ColumnA = Total.
Note the number of rows will change on refresh, however the date and time rows will always be 3 &4 .
[embed=file 1052427]
To fix your pasted formula use this:
=SUMIF(3:3,"<="&TODAY(),INDIRECT("A" & MATCH("total",A:A,0)&":Z" &MATCH("total",A:A,0)))
From there you can probably intuit how to do what you want.
HERE IS MY FINAL SOLUTION - THANKS TO ALL WHO ASSISTED ME WITH THE ISSUE:
=SUMPRODUCT(INDIRECT("a"&MATCH("WorkInProgressSubtotal",A:A,0)):INDIRECT("z"&MATCH("WorkInProgressSubtotal",A:A,0)),--(A3:Z3<=TODAY()),--(A4:Z4<=NOW()-TODAY()))

Resources