# Countif Formula

#### crazyd

##### New Member
I am making a driving log for Drivers Ed students. I need to do a couple of things. (I'm fairly new to Excel).

First off, in E5 I have the start time. (This is in a time format like 1:00 PM)
In F5 I have the end time. (Also in the above time format) In G5 I have the total drive time. I need to have a formula figure the difference between GF and E5 and put the amount (in minutes in G5). Everytime I do it, it comes out weird.

Then in D5 thru D73 I have a Data Validation that puts in either Day or Night. So, I need a formula that checks to see if it says day or night and put the total Driven from the G column for all day in G75 and the total for all night in G76.

I hope I haven't confused everyone here. Can someone help me?

### Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi - welcome to the board!

re your first question - there's some info in this thread that might help out:

http://www.mrexcel.com/board/viewtopic.php?topic=20831&forum=2&1

Once you've got that sorted, it should be fairly simple to to the second bit - use sumif though, not counif.

Post back with results / more info if you need anything else,

I had some time, so I hope this helps.
Columns A and B are formatted for time.
Column C and E are custom formatted to [hh]:mm
Book1
ABCDE
113:3014:3001:00night03:15
212:0013:3301:33day
314:3016:4502:15night
49:3013:0003:30day05:03
Sheet1

Idle time, Brian - been at the kava again?

If I did, this is the LAST place I'd be!

Replies
1
Views
194
Replies
8
Views
543
Replies
2
Views
331
Replies
7
Views
585
Replies
4
Views
399

1,218,945
Messages
6,145,372
Members
450,612
Latest member
OVSD_DS

### 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.

### Which adblocker are you using?

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

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