How to get rank based on 2 column with datetime and date in Excel - excel-formula

I have a data set below and would like to get a ranking based on datetime and date. Hence, I would like to seek for advise that which formula able to suit with the expected result.

Use COUNTIFS():
=COUNTIFS(B:B,B2,A:A,"<="&A2)
Put that in C2 and copy down.

Related

Rank based on filtered Date

just trying to overcome that ranking problem and i stuck to find the solution for it.
Basically, i would like to rank on below based on Date filter on Cell C2.
But only want to start the ranking from cell A20 when it matches with the filtered Date.
Also increment identical values on "Prob" column by one
is there any way to do it please?
Use COUNTIFS with a relative reference:
=IF(AND($A6=$C$2,$B6<>""),COUNTIFS($A$6:$A6,$C$2,$B$6:$B6,"="&$B6)+COUNTIFS($A:$A,$C$2,$B:$B,">"&B6),"")

How to take the cumulative sum of data up to a specific date?

I would like to find a formula that takes the cumulative sum up until a specific date specified. Ideally a formula that contains the date function so the user can select which date to have the cumulative sum of. For example:
In this example I chose a specific date in the highlighted cell and the corresponding answer it should have using the correct formula.
One way is to use FILTER if you have the newest version of Excel.
For example: =SUM(FILTER($J$2:$J$5, $I$2:$I$5<=I8))
Another way is to use SUMIF. For example: =SUMIF($I$2:$I$5, "<="&I8, $J$2:$J$5)

How can I convert a date to YYYY-MM format so I can do SUMIFS?

I have spent hours searching for this online but I don't know why I can't find the correct answer. I have a dozens of rows in column G with dates like 6/6/2019 or 2/1/2020. I am trying to get all of them in the format YYYY-MM on another column E and then do SUMIFS based on that column. The SUMIFS will be looking for the criteria YYYY-MM and adding other columns.
Using Row 14 as an example, I used this formula on Column E: TEXT(G14,"YYYY-MM")
The result of 2019-06 on cell E14 LOOKS like how it's supposed to look like but something is wrong with the formatting. The SUMIFS return 0. If I search column E for 2019-06, Excel doesn't find anything even though I see multiple cells with that value. The only way the SUMIFS work if I copy and paste col E as values which is less than ideal.
Any thoughts would be much appreciated. Thanks.
This might help:
=TEXT(date,"yyyymm")
Likewise, if you want to convert date to text, use:
=TEXT(date,format)

Excel proper date format in Excel

I have worksheet named as Correlation_Process and it contains the field of Birthdate and Age.
what i want to do is to get the age based on the birthdate i already get the age based on the birthdate using excel formula. but some of the rows returns some error like this #VALUE!
Here's my excel formula to get the age: =DATEDIF(A:A,NOW(),"y")
and Here's my date format (Month/day/year) i dont get the error shown in picture which is #VALUE! when some of the rows are showing the expected output
anyone can help?
=DATEDIF(A:A,NOW(),"y")
The formula entered into cell B2 should be this:
=DATEDIF(A2, NOW(), "y")
Copy this formula down the B column and you should have the data you want.
The general formula for DATEDIF is
DATEDIF(first_date, second_date, UNIT)
Why dont you try something like this:
=TEXT(TODAY();"yyyy")-TEXT(A2;"yyyy")
And see if it works
OK lets go back to basics and the sure fired way to snag the date. We will rip apart the date manually and then recombine it.
Start by ripping apart the date into Day, Month and Year
Day
=MID(A2,4,2)
Month
=Left(A2,2)
Year
=Right(A2,4)
Now we will want to combine those values into the DATE(year,month,day) function.
=DATE(Right(A2,4),Left(A2,2),MID(A2,4,2))
Now you will want to use that in your DATEDIF formula
=DATEDIF(DATE(Right(A2,4),Left(A2,2),MID(A2,4,2)),NOW(),"y")
This assumes your dates are in the A column starting in ROW 2. Place the above formula in B2 and copy down. This is all based on your dates being text and not serial dates.

Telling whether a date is before a particular time in excel

I have a spreadsheet with a date column in Column A. I want to have a column where it returns TRUE if the date is before September 2016. How do I do that?
I tried this code in Excel but it wouldn't work.
=if(A1="2017","TRUE",if(month(F1)<"September,"FALSE","TRUE"))
Can anyone help me correcting this one? Thanks
I'm assuming Column A has the actual dates (ex: 3/3/2017). So your if statement (if<"September") is trying to compare text against a date, which will give you an error.
Easiest way to do this is enter 9/30/2016 in a separate cell (for this example, say Q1). Then in your formula, simply use:=A1 < $Q$1 and drag that down. It should give you T/F for the dates.
If Column A is formatted as a date, it has to be compared with a date only. If not excel will give you unexpected results.
The DATE function in excel allows you to input data in date format with Years, Months and Days. The format is below,
=DATE(Years,Months,Days)
You can try the below formula,
=A1<DATE(2016,9,30)
and drag it down throughout the range.

Resources