#### How to add formulas together, hours & minutes function.

```Hi Group,

Please could you give me an all singing, all dancing formula, or an
explanation of how to put these together.

A1        B1
23:00    07:30    =IF(B1<A1,B1+1,B1)-A1

This gives me the hours and minutes 8:30 in C1 (Format/Custom/HH:MM)
One hour needs to be added so... =C1+01:00 gives me 09:30 in D1
(Format/Custom/HH:MM)
Then I need it dislayed in decimal format =D1*24 which gives me 9.5 in
E1(Format/General)

It's not actually set out like that A1 B1 C1 D1, with the result I need in
E1, but it makes it easier to explain.

It's not urgent, as I already have the calculator working, I'd just like to
use this function elsewhere :-)

Next on the list is how to round up and down, for when the hours are not as
straightforward, I round them to the nearest 1/4 of an hour, for example

23:10    07:45  = 9.666666667  (It should be 9.5 by using  23:15  07:45)
21:05    11:30  = 15.41666667  (It should be 15.5 by using 21:00  11:30)

Can all of this be put in one formula?

These functions will be used on a spreadsheet and the final values copied
across to another spreadsheet, so it doesn't matter if extra columns need to
be created or hidden.

Can you help?

Cheers

Rob

```
 0
rob8682 (3)
2/9/2007 4:44:13 AM
excel 39879 articles. 2 followers.

8 Replies
815 Views

Similar Articles

[PageSpeed] 23

```>23:10    07:45  = 9.666666667

The correct result is 9.583333333

> 23:10    07:45.....(It should be 9.5 by using  23:15  07:45)
> 21:05    11:30.....(It should be 15.5 by using 21:00  11:30)

Instead of rounding the times, round the final result.

Try this:

=IF(COUNT(A1:B1)=2,ROUND((B1-A1+(B1<A1)+1/24)*24/0.25,0)*0.25,"")

> One hour needs to be added

That's what this is doing: +1/24

Biff

"Rob S" <rob@privacy.net> wrote in message
news:x_Syh.8360\$9S5.2911@text.news.blueyonder.co.uk...
> Hi Group,
>
> Please could you give me an all singing, all dancing formula, or an
> explanation of how to put these together.
>
> A1        B1
> 23:00    07:30    =IF(B1<A1,B1+1,B1)-A1
>
> This gives me the hours and minutes 8:30 in C1 (Format/Custom/HH:MM)
> One hour needs to be added so... =C1+01:00 gives me 09:30 in D1
> (Format/Custom/HH:MM)
> Then I need it dislayed in decimal format =D1*24 which gives me 9.5 in
> E1(Format/General)
>
> It's not actually set out like that A1 B1 C1 D1, with the result I need in
> E1, but it makes it easier to explain.
>
> It's not urgent, as I already have the calculator working, I'd just like
> to use this function elsewhere :-)
>
>
> Next on the list is how to round up and down, for when the hours are not
> as straightforward, I round them to the nearest 1/4 of an hour, for
> example
>
> 23:10    07:45  = 9.666666667  (It should be 9.5 by using  23:15  07:45)
> 21:05    11:30  = 15.41666667  (It should be 15.5 by using 21:00  11:30)
>
>
> Can all of this be put in one formula?
>
> These functions will be used on a spreadsheet and the final values copied
> across to another spreadsheet, so it doesn't matter if extra columns need
> to be created or hidden.
>
>
> Can you help?
>
> Cheers
>
> Rob
>

```
 0
biffinpitt (3172)
2/9/2007 5:09:16 AM
```T. Valko wrote:
>> 23:10    07:45  = 9.666666667
>
> The correct result is 9.583333333
>
>> 23:10    07:45.....(It should be 9.5 by using  23:15  07:45)
>> 21:05    11:30.....(It should be 15.5 by using 21:00  11:30)
>
> Instead of rounding the times, round the final result.
>
> Try this:
>
> =IF(COUNT(A1:B1)=2,ROUND((B1-A1+(B1<A1)+1/24)*24/0.25,0)*0.25,"")
>
>> One hour needs to be added
>
> That's what this is doing: +1/24
>
> Biff

Cheers Biff, that works perfectly.  I just used it on a s/shet I'd already
done and it matched my figures every time.  This'll save me a few hours a
day...  to do the other work!

Rob

>
> "Rob S" <rob@privacy.net> wrote in message
> news:x_Syh.8360\$9S5.2911@text.news.blueyonder.co.uk...
>> Hi Group,
>>
>> Please could you give me an all singing, all dancing formula, or an
>> explanation of how to put these together.
>>
>> A1        B1
>> 23:00    07:30    =IF(B1<A1,B1+1,B1)-A1
>>
>> This gives me the hours and minutes 8:30 in C1 (Format/Custom/HH:MM)
>> One hour needs to be added so... =C1+01:00 gives me 09:30 in D1
>> (Format/Custom/HH:MM)
>> Then I need it dislayed in decimal format =D1*24 which gives me 9.5
>> in E1(Format/General)
>>
>> It's not actually set out like that A1 B1 C1 D1, with the result I
>> need in E1, but it makes it easier to explain.
>>
>> It's not urgent, as I already have the calculator working, I'd just
>> like to use this function elsewhere :-)
>>
>>
>> Next on the list is how to round up and down, for when the hours are
>> not as straightforward, I round them to the nearest 1/4 of an hour,
>> for example
>>
>> 23:10    07:45  = 9.666666667  (It should be 9.5 by using  23:15 07:45)
>> 21:05    11:30  = 15.41666667  (It should be 15.5 by using
>> 21:00  11:30) Can all of this be put in one formula?
>>
>> These functions will be used on a spreadsheet and the final values
>> copied across to another spreadsheet, so it doesn't matter if extra
>> columns need to be created or hidden.
>>
>>
>> Can you help?
>>
>> Cheers
>>
>> Rob

```
 0
rob8682 (3)
2/9/2007 2:12:48 PM
```You're welcome. Thanks for the feedback!

Biff

"Rob S" <rob@privacy.net> wrote in message
news:Aj%yh.8544\$9S5.176@text.news.blueyonder.co.uk...
> T. Valko wrote:
>>> 23:10    07:45  = 9.666666667
>>
>> The correct result is 9.583333333
>>
>>> 23:10    07:45.....(It should be 9.5 by using  23:15  07:45)
>>> 21:05    11:30.....(It should be 15.5 by using 21:00  11:30)
>>
>> Instead of rounding the times, round the final result.
>>
>> Try this:
>>
>> =IF(COUNT(A1:B1)=2,ROUND((B1-A1+(B1<A1)+1/24)*24/0.25,0)*0.25,"")
>>
>>> One hour needs to be added
>>
>> That's what this is doing: +1/24
>>
>> Biff
>
> Cheers Biff, that works perfectly.  I just used it on a s/shet I'd already
> done and it matched my figures every time.  This'll save me a few hours a
> day...  to do the other work!
>
> Rob
>
>
>>
>> "Rob S" <rob@privacy.net> wrote in message
>> news:x_Syh.8360\$9S5.2911@text.news.blueyonder.co.uk...
>>> Hi Group,
>>>
>>> Please could you give me an all singing, all dancing formula, or an
>>> explanation of how to put these together.
>>>
>>> A1        B1
>>> 23:00    07:30    =IF(B1<A1,B1+1,B1)-A1
>>>
>>> This gives me the hours and minutes 8:30 in C1 (Format/Custom/HH:MM)
>>> One hour needs to be added so... =C1+01:00 gives me 09:30 in D1
>>> (Format/Custom/HH:MM)
>>> Then I need it dislayed in decimal format =D1*24 which gives me 9.5
>>> in E1(Format/General)
>>>
>>> It's not actually set out like that A1 B1 C1 D1, with the result I
>>> need in E1, but it makes it easier to explain.
>>>
>>> It's not urgent, as I already have the calculator working, I'd just
>>> like to use this function elsewhere :-)
>>>
>>>
>>> Next on the list is how to round up and down, for when the hours are
>>> not as straightforward, I round them to the nearest 1/4 of an hour,
>>> for example
>>>
>>> 23:10    07:45  = 9.666666667  (It should be 9.5 by using  23:15 07:45)
>>> 21:05    11:30  = 15.41666667  (It should be 15.5 by using
>>> 21:00  11:30) Can all of this be put in one formula?
>>>
>>> These functions will be used on a spreadsheet and the final values
>>> copied across to another spreadsheet, so it doesn't matter if extra
>>> columns need to be created or hidden.
>>>
>>>
>>> Can you help?
>>>
>>> Cheers
>>>
>>> Rob
>
>

```
 0
biffinpitt (3172)
2/9/2007 6:33:27 PM
```Hi Biff,

What is the correct result for
21:05 - 11:40
?

Your formula gives 15.5 but shouldn't it be 15.75?

15.75 would be our result if we round each input time, not just the
result:
=IF(COUNT(A1:B1)=2,1+(ROUND((B1+(B1<A1))*96,0)-ROUND(A1*96,0))/4,"")

Regards,
Bernd

```
 0
bplumhoff1 (208)
2/10/2007 10:56:23 AM
```>What is the correct result for 21:05 - 11:40?
>Your formula gives 15.5 but shouldn't it be 15.75?

I don't think so.

A1 = 21:05
B1 = 11:40

=B1-A1+(B1<A1)

returns: 14:35 (formatted as h:mm)

Add the hour (as per the op)

15:35

Rounded to the nearest 15m = 15:30

Converted to decimal = 15.5

Biff

"Bernd" <bplumhoff@gmail.com> wrote in message
> Hi Biff,
>
> What is the correct result for
> 21:05 - 11:40
> ?
>
> Your formula gives 15.5 but shouldn't it be 15.75?
>
> 15.75 would be our result if we round each input time, not just the
> result:
> =IF(COUNT(A1:B1)=2,1+(ROUND((B1+(B1<A1))*96,0)-ROUND(A1*96,0))/4,"")
>
> Regards,
> Bernd
>

```
 0
biffinpitt (3172)
2/10/2007 7:57:27 PM
```Hi Biff,

If Rob is happy then it's fine.
But if he has a time system or a rule which asks for rounded inputs
then it can differ from a rounded result.

Regards,
Bernd

```
 0
bplumhoff1 (208)
2/10/2007 9:35:22 PM
```Bernd wrote:
> Hi Biff,
>
> If Rob is happy then it's fine.
> But if he has a time system or a rule which asks for rounded inputs
> then it can differ from a rounded result.
>
> Regards,
> Bernd

Hi Bernd

> What is the correct result for 21:05 - 11:40?
> Your formula gives 15.5 but shouldn't it be 15.75?

The result would be 15.75 if the times had been 21:00 - 11:40.  The times
are not required to be (in this case) *only* rounded up, it's just to the
nearest 1/4 hour, up *or* down. I see what you're getting at, but this
formula rounded them up and down exactly the way I would do it.

Great help this group isn't it! :-)

Cheers for the input

Rob

```
 0
rob8682 (3)
2/11/2007 5:23:46 PM
```Just a thought.......

If you need to round the times *before* the calculation.....

Someone could "game" the system and get an extra 15m pay per day (based on
Bernd's scenario).

I know a lot of people that come up with ways to get over! One of the most
egregious and outrageous offenders I've ever seen went on to become a member
of upper management! If they only knew what this person was doing!

Biff

"Rob S" <rob@privacy.net> wrote in message
news:CiIzh.10000\$9S5.2223@text.news.blueyonder.co.uk...
> Bernd wrote:
>> Hi Biff,
>>
>> If Rob is happy then it's fine.
>> But if he has a time system or a rule which asks for rounded inputs
>> then it can differ from a rounded result.
>>
>> Regards,
>> Bernd
>
> Hi Bernd
>
>> What is the correct result for 21:05 - 11:40?
>> Your formula gives 15.5 but shouldn't it be 15.75?
>
> The result would be 15.75 if the times had been 21:00 - 11:40.  The times
> are not required to be (in this case) *only* rounded up, it's just to the
> nearest 1/4 hour, up *or* down. I see what you're getting at, but this
> formula rounded them up and down exactly the way I would do it.
>
> Great help this group isn't it! :-)
>
> Cheers for the input
>
> Rob
>
>
>

```
 0
biffinpitt (3172)
2/11/2007 7:38:36 PM

Similar Artilces:

::DrawText function
Forgive me if I appear to be thrashing a dead horse here, but I am making progress. I'm using the DrawText function in a windowless ActiveX control. This is working fine, although for some strange reason it is outputting the text on a white background - i.e. there is white surrounding the text, but nowhere else. I have managed to prove to myself that it is not because there is a white brush selected into the device context at the time, because I changed the definition of white to be RGB(255,255,0) i.e. yellow, instead of white, and it was still white. Besides there is a black brus...

Formulas #16
=SUM(IF(ISTEXT(D6:S6),1,0)) Whatever the result of the above formulas, I want to minus 1 to that result, How do I put the syntax so it will minus 1 unit from the result? Thanks =SUM(IF(ISTEXT(D6:S6),1,0))-1 -- Regards Frank Kabel Frankfurt, Germany "Raymond" <NotValidEmail@yahoo.com> schrieb im Newsbeitrag news:DLCdnW0OQ_lEp8ncRVn-pw@comcast.com... > =SUM(IF(ISTEXT(D6:S6),1,0)) > > Whatever the result of the above formulas, I want to minus 1 to that result, > How do I put the syntax so it will minus 1 unit from the result? > > Thanks > > What ...

I need to add 4 "technical contact" fields (which would lookup the Contact entity) to the CONTRACT form. Is this possible? I've found it difficult to figure out what to do first. Thanks in advance, Brandon Not possible. You cant have multiple lookups for the same entity. You also cannot create new relationships between two system entitites. This will work in 4.0 Not possible, Pezman. N:M relationships are not possible in 3.0 yet. There is a alternative solution: a new entity to act as an N:M relationship. In your case, Contract/Contact. This entity has two 1:N relations...

What is the name of the template wizard with Data Tracking (Excel. I can not locate the add in template wizard with Data Tracking in Office 2003 Hi Richard You are not the only one<g> The Add-in is working in 2003 only the install file is not working. Copy the xla file from a PC with 2002 to the PC with 2003 and it will work(use Tools>add-ins to browse to the file in Excel) -- Regards Ron de Bruin http://www.rondebruin.nl "Richard" <Richard@discussions.microsoft.com> wrote in message news:193C5DFD-578D-48F7-B9D6-9FEF5BDCEB64@microsoft.com... > What is t...

DateDiff Calculation -hours & minutes
Hi there I have a query with a formula to calculate the number of hours a load has taken. It is: =DateDif("h",[Startloaddatetime],[FinishLoaddatetime]) it shows the number of hours rounded up to the nearest hour. I want it to show the minutes as well. Is there a way to do this, if so, how is it done? -- Thank-you! Ruth Ruth, Try one of these: http://www.pacificdb.com.au/MVP/Code/Age2.htm http://www.pacificdb.com.au/MVP/Code/Diff2Dates.htm Regards, Graham R Seach Microsoft Access MVP Sydney, Australia "Ruth" <Ruth@discussions.microsoft.com> wrot...

Hello, Here is a scenerio. A client is buying 1lb of ham. It is put on a waxed paper then wrapped into a white paper and then put into a shopping bag. The usage of shopping bag is 100% cases the usage of paper is only with certin categories of sales. Same with the waxed paper. Question: Is there a way of associating wax paper, white paper and shopping bags in a way so with every sale a piece of paper gets deducted from inventory and one bag is deducted from inventory? I would like to run a report every so often and see if I need to purchase any supplies. Kits and assembly do not work...

add a row or column to a single cell in exel
I am trying to split a single cell into 2 rows can you help If I understood correctly you want to enter an entry in two lines in a cell at appropirate place hit lt+enter and again hit enter for e.g venkat (alt+enter) raman(enter) "trev" <trev@discussions.microsoft.com> wrote in message news:89B2C15C-057F-43B9-8282-37923D5EA397@microsoft.com... > I am trying to split a single cell into 2 rows can you help ...

Is there a way to delete old or no longer used email addresses that appear in the drop down box when I am addressing a new email? Shebubba wrote: > Is there a way to delete old or no longer used email addresses that appear in > the drop down box when I am addressing a new email? That is the nickname cache. Search and delete the .nk2 file. That's the cache for nicknames (i.e., your manually entered e-mail addresses). If you only want to delete some of them, highlight an entry and hit the delete key. If that doesn't work, use Nirsoft's NK2 Viewer utility (it e...

I would like to create a custom application that has the ability to maintain the items that are on certain Task Pads within POS 2009. These items would all be regular menu items (ex: hamburger, hot dog, french fries, etc) and not functions. For example, if a task pad was supposed to allow the cashier quick access to daily specials, then this custom application would need to be able to clear the task pad each day and add the items for that day. Is this going to be possible? Please provide some guidance. Thank you, Sean This is a multi-part message in MIME format. ------=_NextPart_00...

Formatting within function/equations
Trying to do some vlookup equations... they are working fine, but they only bring over the value, not the formating. In the particular problem I'm working on, the text value may or may not end with a superscripted number (test^1). When the vlookup happens, the text appears the superscripted number appears as regular text (test1). Anyway to build formating capabilities within an equation? Formulas return values--not formatting. Maybe you could use a macro to copy|paste??? jomurf wrote: > > Trying to do some vlookup equations... they are working fine, but they only > bri...

Every time I open Outlook 2007 I get an error message regarding an add-in 'DCCExtensions' (DCCEXT32.DLL). It says the add-in cannot be loaded and has been disabled by Outlook. I've been getting this message ever since I uninstalled Winfax. How do I make this error stop appearing? Thanks. -- kapibarra Remove the addin from OL by using Trust Center, Addins. http://office.microsoft.com/en-us/outlook/HA100341271033.aspx#14 "kapibarra" wrote: > Every time I open Outlook 2007 I get an error > message regarding an add-in 'DCCExtensions' (DCCEXT32.DLL). ...

I have two fields that should match, but one includes special characters while the other does not. Example: Field1 00ABCD123456123 Filed2 00/ABCD/123456/123/SBZ I need to find records where these two fields don't match, either by changing the display of one of them, or a query to compare Field1 character 7-15 with Field2 characters 9-14, 16-18. Hope this makes sense. Can anyone help? Thanks! Take a look at the following from the Access Help file it might be what you're looking for... Extract a part of a text value The following table lists examples of expressions that ...

Excel formula for this...
Ok i want an excel formula to do this hopefully simple task... Say i have cell A1 with the word "dog" in it and cell B2 with the word "Cat" in it i want cell H5 to have the data in the previously mentioned cells so that it reads "dog, Cat" So in english i guess i want multiple cell values in once cell separated by a space or a comma or whatever. Thanks Max Try: =A1&", "&B2 MRO "Max Sand" <Max@gk.com> wrote in message news:Yx55b.4433\$bC1.2817@newsfep4-winn.server.ntli.net... > Ok i want an excel formula to do this hope...

add a DC in a LegSite
Hi, In the disaster recovery plan we want to create a leg site and put a DC in it. Here are some questions on how to achieve this smoothly. 1. Should I create the new site/subnet first and then promote a server in that subnet/site to DC, or should I promote a server in existing site/subnet and then move this DC to the new site/subnet? 2. When promoting a server to DC, should the server be a member server (already joined the domain) or just a workgroup member (no domain membership)? 3. The DC will be an AD-integrated DNS server. Should I install the DNS component (but not confi...

Computing formula for time
I have three columns: StartTime, EndTime, TimeTaken and the format of all three is "time" Now i want to compute the time taken using start time and endtime. i.e timetaken = endtime - starttime Can anybody tell how to add funtion for this in My sheet. i.e on entering endtime and starttime i should get the time taken Rohit Hi Rohit! The following return the answer in time serial numbers representing decimal parts of a day. =B1-A1+(B1<A1) OR: =B1-A1+IF(B1<A1,1,0) OR: =MOD(B1-A1,1) In all cases we can choose the time format to be displayed. hh:mm:ss displays 09:15:00 h:...

How to sort using formula?
Does anybody know a trick to sort data using formula? Example: User input: 2,5,1,3,4 Formula result (referring to user input cells): 1,2,3,4,5 Thanks Arie Arie, I'm not sure about what you want but I'll give it a try. Suppose your user entry is in column A1:A5 Select B1:B5 ( B1 will be the highlighted "active" cell) and type =Small(A1:A5,{1,2,3,4,5}). Confirm the formula not with <ENTER> but with <CNTRL>+<SHIFT>+<ENTER>. Tis is called array input of the formula. In cell B1:B5 the figures you gave are now ordered (ascending). I hope this i...

subtract half an hour from hours and minutes
could somebody please point me in the right direction here. Im tryin subtract 30 minutes form a cell containing a number of hours an minutes formatted using [h}:mm custom cell forma -- MajorGeneralDe ----------------------------------------------------------------------- MajorGeneralDes's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=370 View this thread: http://www.excelforum.com/showthread.php?threadid=31945 Any of these will work: =A1-"00:30" =A1-TIME(,30,) =A1-1/24/2 HTH Jason Atlanta, GA >-----Original Message----- > >could somebod...

How can I add the customer's PO# to the drop-ship Purchase Order?
Our purchasing agent would like to be able to have the customers PO# from the Sales Transaction Entry screen show up on the PO's. Is this doable in Report Writer or can it not be done? We are using GP v9.0. As I still consider myself a newbie with RW, I would appreciate detailed instructions if possible. Thank you in advance for all responses. It is not possible thru traditional table relationships in Report Writer. Let me explain: you can certainly link the Purchase Order Work table to the SOP_POLink table and the SOP_POLink table to the SOP Transactions Work table, but will...

Awhile back, there was an add-on for excel that had a lot more tools. It showed on the toolbar. Somehow I lost it and I would like to get it back. It had a lot of tools like for changing case and fill ins. Any help wouyld be great. Maybe ASAP Utilities. Try a 'net search for this add-in. Gord Dibben MS Excel MVP On Sun, 22 Mar 2009 20:22:43 -0400, "kmkx70a" <kmkx70a@prodigy.net> wrote: >Awhile back, there was an add-on for excel that had a lot more tools. It >showed on the toolbar. Somehow I lost it and I would like to get it back. It >had a lot of t...