Average if

Gareth246

New Member
Joined
Aug 20, 2020
Messages
7
Office Version
  1. 2019
Platform
  1. Windows
In my data set each line has a persons name, there are a total of 5 names. After their name is a start time and date and after that is a Finnish time and date.
This is laid out from column a to c

each name has multiple entry’s in the data set anywhere from 20 to 70 entry’s each day.

is there a formula that can look at the persons name, let’s say, “James” and average the difference between column b & c which is his start time and end time.

the catch is, I also need to see the time that he was not working on a job combined with the time he was on a job. Now if I run a sum for downtime and drag down I have to manually check to make sure this isn’t including when he finishes work on one particular day and then starting on the next, as this will throw the average time out drastically.

this is something I need to happen in a formula rather than filtering or manually entering as I would have to repeat this process daily and across 10 workbooks which seem inefficient.

at the moment I’m using an advanced filter to copy unique only to a different work sheet to give me the list of names, I’ve made this a macro and added some vba so this macro runs every 10 minutes. This means that if a new person enters on to the works sheet throughout the day I can see them in my summary, from there I’m doing an averageif on their names with the range as a sum of Finnish time - start time, and start time - Finnish time.

but as I suggested this doesn’t work when the date rolls over, or when the entry of James turns in to the entry of Adam in the next line for example.

many one have any ideas?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Are you able to add a column in additional column to the worksheet? As far as I can tell the best way to get your average is to make column D have the formula C-E and then wherever you put your averages have the formula =AVERAGEIF(A:A,"James",D:D)
 
Upvote 0
Just realized i mistyped that. The formula should be C-B. So in cell D1 should be =C1-B1
 
Upvote 0
Hi. Is really important when you want some help, to upload a partial worksheet with the ideas what are you looking for, images are so important
because jondavis say you need just D1= C1 - B1, is that true ?
also is important when you post something, respond ASA to any comment, say something.
 
Upvote 0

Forum statistics

Threads
1,215,028
Messages
6,122,753
Members
449,094
Latest member
dsharae57

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