1

I've got a column of bus stop ID numbers (Column A) and Column B are various timings of which each value is the time a person boards/alights the bus. In order to know how long the bus is stopped, I want to find the difference between the max/min in Column B given a certain 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 rows should print 00:00:17, the next 4 is 00:00:04 etc. since they are of the same A value. Is this possible? Feel like its getting close but not quite. Thanks a million. Any help would be greatly appreciated

1 Answer 1

3

Use this one:

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

and press CTRL+SHIFT+ENTER to evaluate it.

Test workbook

Sign up to request clarification or add additional context in comments.

12 Comments

how did you improve the typography of your answer?
sorry, Garry, what do you mean?)
I mean the use of "pictures" for CTRL + SHIFT + ENTER
use <kbd>..</kbd> like this: <kbd>CTRL</kbd>+<kbd>SHIFT</kbd>+<kbd>ENTER</kbd>
Thanks for the reply simoco, problem is the values in column A are not in running order. The solution gives the right result for the first value of Column A only. Is there a way to input 'any given constant' instead of '1889'
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.