Specified value in column A, find min / max in column B in EXCEL

I have a column of identification numbers (Column A) and Column B are different timings, each of which is the time when the character pays / misses the bus. To find out how long the bus has stopped, I want to find the difference between the maximum / minimum value in column B for a given value of A.

84009 9:17:38 AM 84009 9:17:40 AM 84009 9:17:41 AM 84009 9:17:43 AM 84009 9:17:50 AM 84009 9:17:55 AM 84029 9:22:47 AM 84029 9:22:47 AM 84029 9:22:49 AM 84029 9:22:50 AM 84019 9:23:49 AM 83049 9:28:19 AM 82069 9:32:32 AM 82069 9:32:49 AM 82049 9:33:58 AM 82049 9:33:58 AM 82049 9:33:59 AM 82049 9:34:02 AM 82049 9:34:10 AM 82029 9:35:13 AM 

So, the first 7 lines should print 00:00:17, and the next 4 should print 00:00:04, etc., since they have the same value A. Is this possible? Feel it approaching, but not quite. Forever grateful. Any help would be greatly appreciated.

+1
max conditional excel excel-formula min
source share
1 answer

Use this:

 =MAX(IF(A1:A6=1889,B1:B6))-MIN(IF(A1:A6=1889,B1:B6)) 

and press CTRL + SHIFT + ENTER to evaluate it.

Test book

+3
source share

All Articles