Every first time of the day

mrwul62

Board Regular
Joined
Jan 3, 2016
Messages
61
Office Version
  1. 365
Platform
  1. Windows
Have been puzzling about the below quite a while. Hope someone can help me out on this.

Column A contains days, multiple rows per day
Column B contains hours, multiple rows per day

I'd like to select/filter the 'earliest' hour (first entry) of each day.

How to filter those?
Example below.


-day time
08-12-2016
09:21:06
08-12-201609:20:49
08-12-2016
05:10:06
07-12-201616:47:42
07-12-201616:44:40
07-12-201616:44:25
07-12-201608:15:55
07-12-201608:15:55
07-12-201608:15:55
07-12-201608:15:55
07-12-201605:08:23
06-12-201616:46:59
06-12-201616:41:04
06-12-201616:40:48
06-12-201604:20:05
05-12-201617:14:36

<colgroup><col><col></colgroup><tbody>
</tbody>

-etc-

Thanks.
=
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
In cell C2:

=MIN(B1:B100)

Sorry I didn't see the dates are different. You will need an index match array for that. I will get to it.
 
Last edited by a moderator:
Upvote 0
Try this:

Sheet3

ABCDE
21/1/20171:05:00 AM 1/1/20171:05:00 AM
31/1/201712:05:00 PM 2/1/20171:32:00 AM
41/1/20171:15:00 AM 1/1/20171:05:00 AM
51/1/20172:00:00 AM
62/1/20171:32:00 AM
72/1/20172:45:00 AM
8

<colgroup><col style="width: 30px; font-weight: bold;"><col style="width: 69.33px;"><col style="width: 86.67px;"><col style="width: 69.33px;"><col style="width: 69.33px;"><col style="width: 86.67px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
E2{=IFERROR(IF(COUNTIF($A$2:$A$10,$D2),MIN(IF($A$2:$A$10=$D2,$B$2:$B$10)),""),"")}

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Last edited by a moderator:
Upvote 0
Try this:

Sheet3

ABCDE
21/1/20171:05:00 AM1/1/20171:05:00 AM
31/1/201712:05:00 PM2/1/20171:32:00 AM
41/1/20171:15:00 AM1/1/20171:05:00 AM
51/1/20172:00:00 AM
62/1/20171:32:00 AM
72/1/20172:45:00 AM
8

<tbody>
</tbody>

Spreadsheet Formulas
CellFormula
E2{=IFERROR(IF(COUNTIF($A$2:$A$10,$D2),MIN(IF($A$2:$A$10=$D2,$B$2:$B$10)),""),"")}

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

First of all: Sorry for the delay...

Many thanks for the above.
I am not an Excel expert, regretfully so.

Gave the formula a try, but I think there may an error somewhere.
Or, I might be doing something wrong, which is most likely...

Hope you can figure out what I am doing wrong.

Thanks again!




 
Upvote 0
That looks correct but did you drag it down after making it an array?
 
Last edited by a moderator:
Upvote 0
I am sorry, I don't know exactly what you mean.

I tried following possibilities
a. clipboard copy from { uptil } ({} included) - then switched to Excel - cel E2 - ctrl-shift-enter : nothing shows up
b. clipboard copy from { uptil } ({} included) - then switched to Excel - cel E2 - paste - ctrl-c E2 - selected region E3-E25 - ctrl-shift-enter: nothing happens
c. select pasted formula in E2, dragged down - formula is copied only

probably ctrl-shift-enter does not work.
and a workaround should be found for that.

I noticed various threads on this non-working ctrl-shift-enter
Sofar I have not found a solution.

I give up.

Thanks anyway!

=
 
Upvote 0
Don't give up .. array formulas are confusing at first but its worth persisting

2 problems - first thing Do NOT enter the curly brackets . when you do CRTL-SHIFT-ENTER excel will put the curly brackets in for you . if you copying-and-pasting from this site just delete the curly brackets
2nd - your data runs from rows 2 to 17 but the formula in post 3 only looks at rows 2 to 10
=IFERROR(IF(COUNTIF($A$2:$A$10,$D2),MIN(IF($A$2:$A$10=$D2,$B$2:$B$10)),""),"")
you should adjust it to include the extra rows
=IFERROR(IF(COUNTIF($A$2:$A$17,$D2),MIN(IF($A$2:$A$17=$D2,$B$2:$B$17)),""),"")

<tbody>
</tbody>

(I have removed the curly brackets for you .. excel will put them back )




<tbody>
</tbody>
 
Upvote 0

Excel 2016
AB
1DayTime
208-Dec-1609:21:06
308-Dec-1609:20:49
408-Dec-1605:10:06
507-Dec-1616:47:42
607-Dec-1616:44:40
707-Dec-1616:44:25
807-Dec-1608:15:55
907-Dec-1608:15:55
1007-Dec-1608:15:55
1107-Dec-1608:15:55
1207-Dec-1605:08:23
1306-Dec-1616:46:59
1406-Dec-1616:41:04
1506-Dec-1616:40:48
1606-Dec-1604:20:05
1705-Dec-1617:14:36
18
19
20Earliest hour for each day
21DayTime
2208-Dec-1605:10:06
2307-Dec-1605:08:23
2406-Dec-1604:20:05
2505-Dec-1617:14:36
26
27
28
Sheet8
Cell Formulas
RangeFormula
A22{=IFERROR(INDEX($A$2:$A$17,MATCH(0,COUNTIF(A$21:A21,$A$2:$A$17),0)),"")}
B22{=IF(A22="","",MIN(IF($A$2:$A$17=A22,$B$2:$B$17)))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Point is: nothing gets pasted at all...

So:
I copy the above, from '=' upto the last ')'
paste it into a -new- sheet will show the formula in the cell (this is just to show that it -is- pasted)

Okay, now the same but then in the sheet with dates/times, select cell e2 and do a ctrl-shift-enter, the cell remains empty and nothing happens.
I might also select the formula from the other sheet and ctrl-shift-enter into E2 with date/time sheet, same thing, E2 remains empty, nothing happens.

One way or the other I get the impression that for one reason or the other ctrl-shift-enter is disabled or so.
(noticed there are many, many questions on Internet regarding the non-working ctrl-shift-enter in Excel)

No idea why it doesn't work.
I disabled my clipboard manager
I had excel started without personal.xlsb

Nothing, bad luck.

=
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,575
Members
449,039
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top