Solved

Formula Revision

Posted on 2013-01-11
6
255 Views
Last Modified: 2013-01-16
Hello Experts,

I have been working on a spreadsheet, with the help of a lot of you great folks at EE! Before I get into my question, I want to explain what this calculator does - that way you'll have a better chance at understanding my problem.

This spreadsheet is designed to track "Talk Time" during the employees shift.  Columns E:I accept time values, in hh:mm:ss format.  In the example I provided (view attachment), you'll see 4 times listed, each time listed represents a phone call and it's duration.

Each time value is added up, and calculated over on the left side.  My problem lies with cell C16.  Now to explain this cell, you'll need to understand this...

For every "ONE" hour the employee works, they need to be talking to customers for 0:24 minutes. So if I work a 5 hour shift, then I will need 2:00 hours of total talk time, or average 0:24 minutes per hour.

Hopefully I haven't lost you...

This value is in the "Today's Progress" section, so I want that information to be "up to the minute".  In order for that field to calculate my minutes per hour of talk time, the spreadsheet needs to know what time of day it is.

As you can see, my formula is referencing cell N2.  In my real world file, the reference will be changed to cell M2. Cell M2 using the =NOW() formula, but cell N2 uses any time value I type in for testing purposes.

Here is my problem...

Let's pretend you just finished your shift, you worked a total of 5 hours.  And during those 5 hours, you talked for a total of 2:00 hours.  You would be averaging 0:24 minutes per hour of talk time.

Let's also pretend, for whatever reason - you view this spreadsheet an hour after your shift ended.  Now change cell N2, to 6:00 PM. You will see cell C16 changes from 0:24 minutes per hour, to 0:20 minutes per hour.

I hope you're still following me here... :)

My goal is to show your average minutes per hour, based on the time you're working. I want it to provide "up to the minute" calculation based on the time of day - but it all runs into a problem if you view this spreadsheet after the fact - therefor reporting an incorrect value.

Does this even make sense?

Any help is greatly appreciated!

~ Geekamo
Talk-Time-Calculator.xls
0
Comment
Question by:Geekamo
  • 3
  • 2
6 Comments
 
LVL 40

Expert Comment

by:als315
ID: 38769479
You can use this for cell C16:
=C17/(MIN(N2;C6)-C5-C7)*60
in this case time over C6 will not be considered
0
 
LVL 40

Expert Comment

by:als315
ID: 38769481
May be you should add max(MIN(N2,C6),C5) if you start before C5:
=C17/(MAX(MIN(N2,C6),C5)-C5-C7)*60
0
 
LVL 1

Author Comment

by:Geekamo
ID: 38769489
@ als315,

"=C17/(MIN(N2,C6)-C5-C7)*60" is great! It does exactly what I wanted.

And as you did notice, starting before your shift results in a negative number.  That is a problem too.

But when I use "=C17/(MAX(MIN(N2,C6),C5)-C5-C7)*60", that results in a DIV/0 error.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 40

Accepted Solution

by:
als315 earned 400 total points
ID: 38769493
It is because C5-C5 =0. You can add some IF for time less then C5. May be IF(N2 < C5, 0, C17/(MIN(N2,C6)-C5-C7)*60)
0
 
LVL 50

Assisted Solution

by:barry houdini
barry houdini earned 100 total points
ID: 38769943
Note that if you use M2 in place of N2, ultimately, with M2 = NOW() then you might experience problems because NOW() also contain the current date (as well as time), however M2 is formatted - that will cause problems when you compare with C6. It might be a good idea to adjust your M2 formula to show the current time excluding the date, i.e.

=NOW()-TODAY()

M2 will look the same as now but it will no longer contain the underlying date element that can affect your calculations.

regards, barry
0
 
LVL 1

Author Comment

by:Geekamo
ID: 38785592
@ als315,

I've been able to use this formula for a couple days now, and it's working perfectly.  Thank you very much!

@ barryhoudini,

Great tip! I adjusted my formula.

Thanks again!

~ Geekamo
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question