How get rows with oldest date - excel

I have table in excel with some columns. There is ID_client and date column, but one client may appear more than once, with different date. My task is to get for all clients rows with the oldest date.
For example, for table:
ID_client date
1 2014-03-01
2 2011-01-06
1 2000-01-15
2 2012-03-16
2 2015-09-26
I should receive:
ID_client date
1 2014-03-01
2 2015-09-26
Thanks in advance for any help.

Step1:
You can go to home>Sort & filter> Custom sort
select date column>newest to oldest
Step2:Select both column> go to DATA > Remove duplicates
Select only ID column there and hit ok.
You should get the desired output.

Related

Convert stock transactions into daily holdings in Excel

interested in converting a transaction statement like so:
Date (DD/MM/YY)
Stock
Flow
11/12/20
Apple
200
12/12/20
Microsoft
50
13/12/20
Apple
-100
into something that looks like:
Date (DD/MM/YY)
Apple
Microsoft
10/12/20
0
0
11/12/20
200
0
12/12/20
200
50
13/12/20
100
50
14/12/20
100
50
Appreciate tips on the best way to go about doing so as I'm not quite sure how to approach this, thanks.
Formulas: (using O365) slightly different approach may be needed in other versions
*note that I created a table out of your stock flow data
F1: Date
G1: =TRANSPOSE(UNIQUE(stockFlow[Stock]))
F2: =ROW(INDEX($A:$A,MIN(stockFlow[Date])-1):INDEX($A:$A,MAX(stockFlow[Date])+1))
G2: =SUMIFS(stockFlow[[Flow]:[Flow]],stockFlow[[Stock]:[Stock]],G$1,stockFlow[[Date]:[Date]],">="&$F$2,stockFlow[[Date]:[Date]],"<=" & $F2)
Select G2 and fill down and across as needed.
Use a Pivot table - create a pivot table, Make "Date" a row and "Stock" a column. Then make "Flow:" a value and change the "Value Field Settings" to "show values as" a "Running Total In..." with "Date" as the base field.
Note that the pivot table will not insert dates that aren't in your raw data, but you could insert rows for the missing dates with a zero flow for any stock to get the table you want:

Use a Count field as a row in Excel Pivot table

Not sure if it is possible but I'd like to have a pivot table that summarizes how many occasions properties have been missed, and then shows the number of times properties have been missed that many times.
What I'm looking to end up with is something like the below:
TIMES MISSED PROPERTIES MISSED THAT AMOUNT OF TIMES
1 102
2 76
3 23
4 11
5 2
Information is currently in the following format:
UPRN DATE MISSED
1029292 1/1/2020
1029292 5/6/2020
1010101 1/2/2020
1046353 4/3/2020
3894387 8/2/2020
3894387 7/2/2020
3894387 9/2/2020
So this would give the following table:
TIMES MISSED PROPERTIES MISSED THAT AMOUNT OF TIMES
1 2
2 1
3 1
Is this possible? And if so, how?
Pivot tables in Excel can summarize data not only with SUM function, but also with COUNT and other functions.
Right-click a field in the "Sum values" field chooser and then select Value Field Settings... From there you can choose the function to summarize your data (COUNT in your case).

Count specific column values by year in another date column in Excel

I have an excel table with two columns and several hundred rows. One column lists a single-digit code that represents an event, the other the date of that event. I'm attempting to count the number of times a particular event (say "1") occurred in a particular year (say 2017).
I normally use "COUNTIFS" for two or more criteria, but I'm stumped by the date format. I can't seem to get it to work in the formula. In this case, I'm using the yyyy-mm-dd format. How can I perform this operation?
A small example of the table is as follows:
------------------------
A B
--+--------------------+
1 Event Date
2 1 2016-09-12
3 1 2019-10-11
4 3 2017-03-24
5 2 2016-05-25
6 3 2017-08-02
7 1 2018-10-11
Just use
=COUNTIFS(A:A,1,B:B,">="&DATE(2017,1,1),B:B,"<="&DATE(2017,12,31))
EDIT:
if you have text-that-looks-like-dates, you can use SUMPRODUCT and YEAR:
=SUMPRODUCT((A2:A7=1)*(YEAR(B2:B7)=2017))

count the total counts of cell per days

I am trying to find out the total number of order made in a day.
My data is like this :-
Date | Time | Product | Unit Sold
7/24/2018 10:45:59 Fries 1
7/24/2018 16:45:59 Fries 1
7/25/2018 12:45:59 Fries 1
7/25/2018 11:45:59 Fries 1
7/25/2018 1:45:59 Fries 1
7/25/2018 1:45:59 Fries 1
Now here you can see the count of 7/24/2018 is 2 , 7/25/2018 is 4 ..
I can manually filter and select all column and just copy the count from bottom bar.
but the problem is I have calculate of about 3 months of about 10 different branches.
I did googled up and found out about COUNTIF . and here what I tried
=COUNTIFS(range,">="&date1,range,"<="&date2)
But it returns me #N/A
Can anyone help me on here?
What you are asking is very simple, and can done with a little focus.
Step 1: Make sure the dates in date column are in the same format as with your system date. If yes then move to step 2, if not, Select date column -> then goto Data tab in Excel ribbon -> Under data tools you will find Text to columns -> Click that and convert the Dates to your system date format. move to Step 2
Step 2:
The formuala you mentioned
=COUNTIFS(range,">="&date1,range,"<="&date2)
I am assuming is an example and real code should look something like this unless you are using Names for ranges
=COUNTIFS(A2:A7,">="&B9,A2:A7,"<="&B10)
OR a better version would be
=SUMIFS(D2:D7,A2:A7,">="&B9,A2:A7,"<="&B10)
since this formula will actually sum up the Unit Sold column instead of date column. Example attached in image below. Enjoy.
sumif and countif example image

Return the earliest time for each day

I have this set of data:
A B
1 1/1/15 6:05am
2 1/1/15 10:00am
3 1/2/15 6:10am
4 1/2/15 11:58am
Data in column A is a valid Excel date field and data in column B is valid Excel time field.
What I am trying to get is the time of the first call per day. Example:
1/1/15 6:05am
1/2/15 6:10am
I have tried PivotTables with sort and groups but that did not work. Any ideas/suggestions are most welcome.
In C1 copied down to suit please try:
=MIN(IF(A:A=A1,B:B))
with Ctrl+Shift+Enter.
However a PivotTable could well be a suitable alternative:

Resources