Aging formula without using additional column - excel-formula

I have a table like below
ID StarDate EndDate
123 6/5/2015 15:54 6/12/2015 15:54
124 6/6/2015 15:54 6/8/2015 15:54
125 6/7/2015 15:54 6/9/2015 15:54
126 6/8/2015 15:54 6/11/2015 15:54
127 6/9/2015 15:54 6/15/2015 15:54
I want to get the total count of aging without using any additional column
0-30 =COUNTIFS(A:A,">124",A:A,"<127",TODAY()-B2:B6,"<=30")
The one above is not working
Please help achieving this.
Thankyou

If your table starts in cell A1, with the first start date in cell B2, try
=SUMPRODUCT(--(C2:C6-B2:B6<=30))
Edit after clarification:
=SUMPRODUCT(--(A2:A6>124),--(A2:A6<127),--(TODAY()-B2:B6<=30))

Related

time in position - excel dates

given the following excel table
I'm trying to add a column with the number of days in a position, my problem is that the 'starting date' for an employee (column b) is the same. This is why I'm struggling with column D creation.
For example: emp 111 the first row is DAYS(B2,C2), but for the second row should be (C2,C3).
I tried to do it with index match array but I can't make it work.
How do I do this kind of calculation?
emp_number
start_working_date
promotion_date
111
2020-01-01
2020-02-04
111
2020-01-01
2020-04-23
111
2020-01-01
2020-08-20
112
2020-03-01
2020-05-01
112
2020-03-01
2020-07-01
113
2020-04-01
2020-08-01
114
2020-05-01
2020-09-01
115
2020-06-01
2020-10-01
Use an IF with MATCH to test if it is the first or not, then subtract from the correct cell:
=IF(MATCH(A2,A:A,0)=ROW(),C2-B2,C2-C1)
Note this only works if the data is sorted correctly. Emp_Number then Promotion_Date.
If the data is not sorted then we can use:
=IF(COUNTIFS(A:A,A2,C:C,"<"&C2)=0,C2-B2,C2-MAXIFS(C:C,A:A,A2,C:C,"<"&C2))
The obligatory discussion on the difference between *IF(s)() and MATCH(). Match is much less intensive on the calcs and as such if it can be done sorting the data and using the first formula will be much more performant.
It will not be noticeable on a dataset of less than a couple thousand. But once the dataset gets above 10,000 the calc times will increase and at some point will fail when using the *IF(s)() function.
You may also try using this, but in your query you have mentioned it wrong since, the syntax of DAYS Function is DAYS(end_date,start_date) where as you have provided as DAYS(start_date,end_date).
• Formula used in cell D2
=IF(COUNTIF($A$2:A2,A2)=1,DAYS(C2,B2),DAYS(C2,C1))

COUNT Function Excel

I have the following table:
oDate oValue
-------------------------------
2019-01-01 00:00 90
2019-01-01 00:30 90
2019-01-01 01:00 86
2019-01-02 00:00 86
2019-01-02 00:30 90
2019-01-02 01:00 86
2019-01-02 01:30 90
I want to have the following result:
oDate 90 86
-----------------------------------
2019-01-01 2 1
2019-01-02 2 2
I want to have the count of each oValue for each different oDate.
Does anyone have the idea for this case?
Thank you.
Put this under the 90 in the second table then drag right and down.
=COUNTIFS($A:$A, ">="&$D2, $A:$A, "<"&$D2+1, $B:$B, E$1)
COUNTIFS as given in another answer in my opinion is the way to go. However if you are interested in seeing other potential methods, you could do this with SUMPRODUCT. The reason I advise against it is as the data gets large, you can wind up doing an extrodinary number of calculations. Also with SUMPRODUCT, since it is performing array calculations, full column references should be avoided. Where as with COUNTIFS full column references wont make a difference.
So with SUMPRODUCT and assuming the layout in the picture below, use the following formula in C13 and copy down and to the right as required.
=SUMPRODUCT((INT($B$4:$B$10)=$B13)*($C$4:$C$10=C$12))
Adjust the ranges to suit your data.

I am wanting to check whether there is time overlap on a data table

I am working on an excel task where I had to find out if there are overlapping dates.
In my excel worksheet there are columns for Session Date (col B) Session start time (Col C) Session end time (Col D) startDate(column D), from this I had to determine if there is an overlapping session times on the same date.
I have tired INDEX and Match functions, but dont know how to account for multple instances of the same date in comumn B
Date of Treatment Pre-Treatment Time Post-Treatment Time
28/03/2018 09:15 09:29
28/03/2018 10:42 11:07
28/03/2018 15:10 15:19
16/01/2018 10:51 11:02
30/08/2018 09:16 09:32
30/08/2018 09:51 10:15
30/08/2018 11:15 11:26
30/08/2018 14:23 14:36
30/08/2018 14:59 16:01
30/08/2018 17:18 17:28
I want to be able to flag sessions where there is an overlap or say they are fine
Try sorting your data by date then start time, then if the start time of the second entry is lower than the previous row's end time, you know they are overlapping.
It seems you need to use MAX and MIN functions to check that and return the overlap. And throw it inside a IF function to return overlp or not.
Try this:
Date of Treatment on A1 and the rest of the info on the following columns.
On D1 write "Check"
On G1 name the range as "start"
On G2 name the range as end
After you set up put the fomrula in D2 and drag to the end of the range.
=IF(MAX(MIN(end;A2)-MAX(start;A2)+1;0)=0;"Not overlap";"Overlaps")
To acomplish what you wnat you need to delimit the date and you do that by using the named ranges START and END.
Below is an image of the table I tested.
SCREEN TEST FORMULA
Hope it helps!
Let me know if you managed the problem!

Summing every first month columns in Excel

I am trying to add the sum of the first 7 columns and then the next 7th columns etc in Excel. So for example if I have the below data and I needed to be added weekly,
Day 02/01/2017 03/01/2017 04/01/2017 05/01/2017 06/01/2017 07/01/2017 08/01/2017 09/01/2017 10/01/2017 11/01/2017 12/01/2017 13/01/2017 14/01/2017 15/01/2017
Presented Calls 1000 1550 900 1455 789 987 1435 1200 1675 1230 1232 1400 999 650
So if I want to add the presented calls from 02/01 - 07/01 this should be sum(B2:H2)
Then the sum of the presented calls from 08/01-15/01 this should be sum(I2:M2)
etc
However at the moment in Excel it is being sum(B2:H2) then sum(C2:I2) which is incorrect, can anyone help?
You can use the OFFSET() function combined with the COLUMN() function and a bit of arithmetic to get the desired range to sum.
Try entering this formula and fill across.
=SUM(OFFSET($B$2,0,(COLUMN()-COLUMN($B$2))*7,1,7))

How do I get the highest value in a row in excel

I'm looking to compare the value of the max score of a group of people, format is as follows:
date user1 user2 user3
06/07/2011 123 112 244
How do I determine which of values on the row is the highest? Eg, I would like to pull 244 from this row.
How about using the max-function?
=MAX(b1:d1)
Use the max function in whatever cell you want it in: =Max(A2:A4)

Resources