How do I calculate hours in Numbers?

How do I calculate hours in Numbers? Example: I inserts 7:00 in a cell and 11:30 in another cell. What function do I write to get 4:30?

Hi Interlaga,
Enter start time in A2. Enter finish time in B2. They will become Cell > Data Format > Automatic with Date and Time (Date None).
Formula in C2
=B2−A2
That becomes Cell > Data Format  >Automatic
Refinement is to use 'Date and Time' Format for start and finish, and 'Duration' format for the difference.
Remember that in Numbers, every Date has a Time attached, and every Time has a Date attached (even if they are not displayed in the cell). So if you enter the times on different days (the 'crossing midnight' problem) the finish time will be 24 hours later .
It took me a while to understand this, but a Time or a Date is an instant since 1 January 1904.
Call back for more help.
Regards,
Ian.

Similar Messages

  • How do I calculate hours?

    Hi,
    I allow the user to enter a start time of "0200AM" and an end time of "0330AM". How do I calculate the hours? I tried calendar hours, but I wasn't quite sure how it worked.
    Thanks

    you use the Calendar.set() method to set the specific hour/minutue/am/pm, see the docs for details. then you can do a getTime() which returns a Date object for further manipulation.
    thomas

  • How do I add hours in Numbers?

    I created two columns with time I started working on a job and the time I ended. I would like the final column to add up the hours i worked. How do I do this?

    maricusitin,
    When you subtract a larger number from a smaller number, you will get a negative result. In this case, 1:30 pm is greater than 10:00 am, so you get -3h. If you subtract 10:00 am from 1:30 pm, you should get a positive difference.
    Jerry

  • How can I calculate the Prime Numbers  ?

    Hi everyone ,
    I want to learn how can I do this :
    Write a Pl/SQL program using While loop , which will accept integer from 1 to 50 and generate the prime numbers as showen in the following output :
    The prime numbers from 1 to 50 are as follows :
    1,2,3,5,7,11,13,17,19,23,29,31,37,41,43,47

    HanyFreedom is one of the oracle's teachers that I have asked him yesterday about this Question .. I just know him via the internet ..
    now,
    I'm keep trying to find out what is the right answer..
    and this is my try :
    Declare
    counter number(10):=1;
    j number (4);
    begin
    DBMS_output.put_line('The prime numbers from 1 to 50 are as follows ');
    while counter < 50 loop
    FOR j in 2..50 loop
    if mod(counter,1)=0 and mod (counter,j)<>0 and mod(counter,2)<>0
    then
    dbms_output.put_line(counter);
    end if;
    counter:=counter+1;
    end loop;
    end loop;
    end;
    but there is something error because in the result i get number 49 which is not right
    Message was edited by:
    user635582

  • How do I calculate age (in numbers)

    ... just switched to Numbers, used to Excel...
    I suspect it's got to do with Data Formats...
    Please help!

    I would direct you to existing thread on the subject.
    https://discussions.apple.com/thread/1380192

  • Calculate changing wage rate pr hour in numbers

    Calculate changing wage rate pr hour in numbers:
    Hi I need some help calculating my salary. I get paid different wage rates every hour:
    UGESATSER
    Mandag
    Tirsdag
    Onsdag
    Torsdag
    Fredag
    Lørdag
    Søndag
    1:00
    163,72
    163,72
    163,72
    163,72
    163,72
    163,72
    225,97
    2:00
    163,72
    163,72
    163,72
    163,72
    163,72
    163,72
    225,97
    3:00
    163,72
    163,72
    163,72
    163,72
    163,72
    163,72
    225,97
    4:00
    163,72
    163,72
    163,72
    163,72
    163,72
    163,72
    225,97
    5:00
    163,72
    163,72
    163,72
    163,72
    163,72
    163,72
    225,97
    6:00
    163,72
    163,72
    163,72
    163,72
    163,72
    163,72
    225,97
    7:00
    124,50
    124,50
    124,50
    124,50
    124,50
    124,50
    186,75
    8:00
    124,50
    124,50
    124,50
    124,50
    124,50
    124,50
    186,75
    9:00
    124,50
    124,50
    124,50
    124,50
    124,50
    124,50
    186,75
    10:00
    124,50
    124,50
    124,50
    124,50
    124,50
    124,50
    186,75
    11:00
    124,50
    124,50
    124,50
    124,50
    124,50
    159,36
    186,75
    12:00
    124,50
    124,50
    124,50
    124,50
    124,50
    159,36
    186,75
    13:00
    124,50
    124,50
    124,50
    124,50
    124,50
    159,36
    186,75
    14:00
    124,50
    124,50
    124,50
    124,50
    124,50
    159,36
    186,75
    15:00
    124,50
    124,50
    124,50
    124,50
    124,50
    159,36
    186,75
    16:00
    124,50
    124,50
    124,50
    124,50
    124,50
    159,36
    186,75
    17:00
    124,50
    124,50
    124,50
    124,50
    124,50
    159,36
    186,75
    18:00
    159,36
    159,36
    159,36
    159,36
    159,36
    194,22
    221,61
    19:00
    159,36
    159,36
    159,36
    159,36
    159,36
    194,22
    221,61
    20:00
    159,36
    159,36
    159,36
    159,36
    159,36
    194,22
    221,61
    21:00
    159,36
    159,36
    159,36
    159,36
    159,36
    194,22
    221,61
    22:00
    159,36
    159,36
    159,36
    159,36
    159,36
    194,22
    221,61
    23:00
    159,36
    159,36
    159,36
    159,36
    159,36
    194,22
    221,61
    0:00
    163,72
    163,72
    163,72
    163,72
    163,72
    198,58
    225,97
    How do i make a calculation that includes different rate pr. hour? It would be nice if i just need to put in the dates and time link this and than Numbers calculate my salary based on the different wage rates. Hope you can help. THANKS.
    I have set up my numbers like this:
    Start
    Tid
    lør. 10. januar 07.00
    lør. 10. januar 23.00
    16 timer
    SALARY
    søn. 11. januar 07.00
    søn. 11. januar 23.00
    16 timer
    man. 12. januar 07.00
    man. 12. januar 23.00
    16 timer
    ons. 14. januar 07.00
    ons. 14. januar 23.00
    16 timer
    tor. 15. januar 07.00
    tor. 15. januar 23.00
    16 timer

    No.
    sheet 2 shows my working days from January. Fx.
    lør. 10. januar 07.00
    lør. 10. januar 23.00
    16 timer
    That is a Saturday which means that thies are the wage rates for each hour(sheet 1):
    UGESATSER
    Lørdag
    1:00
    163,72
    2:00
    163,72
    3:00
    163,72
    4:00
    163,72
    5:00
    163,72
    6:00
    163,72
    7:00
    124,50
    8:00
    124,50
    9:00
    124,50
    10:00
    124,50
    11:00
    159,36
    12:00
    159,36
    13:00
    159,36
    14:00
    159,36
    15:00
    159,36
    16:00
    159,36
    17:00
    159,36
    18:00
    194,22
    19:00
    194,22
    20:00
    194,22
    21:00
    194,22
    22:00
    194,22
    23:00
    194,22
    0:00
    198,58
    This day my calculation should calculate this:
    4 hr @ 124,50 (7-11)
    7 hrs @ 159,36 (11-18)
    5 hrs @ 194.22 (18-23)
    0 hrs @ 198,58 (23-24)
    Some times I work efter 00:00 fx. til 4 in the morning.
    THANKS

  • How to calculate hours between two dateTime node in BPEL.

    In my BPEL there's a requirement need calculate hours between two dateTime type..
    I tried 2 solutions, both of them failed:
    1. use xslt calculate duration(xml type, like PT12H) between two dateTime, and then use embedded java code to get the hours.. The problem is : I need to parse the xml duration format...(like this real one: -P80DT17H47M36S....), and to parse it in java , maybe have the same problem with solution 2..
    * [Subtracting 2 dateTime values into a duration using XPath 2.0|http://blogs.oracle.com/rammenon/2007/07/subtracting_2_datetime_values.html]
    2. use embed java code, but it seems we can't use some class in embedded java code:
    my code(input begin, end both dateTime in xml. output: diff, int in xml):
    1 System.out.println("\n\nTimeTestBegin");
    2 String begin=getVariableData("begin").toString();
    3 String end=getVariableData("end").toString();
    4 System.out.println(begin+"-----"+end);
    5 //Class c1=Class.forName("javax.xml.datatype.XMLGregorianCalendar");
    6 //Class c2=Class.forName("javax.xml.datatype.DatatypeFactory");
    7 //System.out.println(c1.getName());
    8 //System.out.println(c2.getName());
    9 javax.xml.datatype.XMLGregorianCalendar beginTime = javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar(begin);
    10 javax.xml.datatype.XMLGregorianCalendar endTime = javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar(end);
    11 long diff=beginTime.toGregorianCalendar().getTimeInMillis()-endTime.toGregorianCalendar().getTimeInMillis();
    12 setVariableData("diff",String.valueOf(diff/1000/3600));
    13 System.out.println("DIFF======"+diff/1000/3600);
    14 System.out.println("TimeTestEnd");
    it's said can't compile java class, but can't find the detail error, I think the problem is how to import java class to embedded java code activity(use full package name like above code don't work), when I remove line 9-13, no compile error..
    BTY: Jdeveloper is a IDE support java, but why the embedded java activity's edit window only have a simple "java code" editor, too simple that it can only edit you code snippet...
    3.There's another sulotion: extend BPEL xpath functions(add a new function), but in my project, modify BPEL server(soa server)'s config file is not allowed..
    Anyone know easy solution to my problem?
    Thanks.

    Hi, All,
    I found the cause. Sorry, it's my mistake..
    below line have a DatatypeConfigurationException:
    javax.xml.datatype.DatatypeFactory.newInstance()
    When I test my java code snippet, I coped the code snippet to one of my java class in eclipse, and put it in a method to check if there's compile error, but I didn't notice there's a "throws Exception"...
    the final java code snippet for test is :
    input: begin dateTime
    input: end dateTime
    output: diff int, how many hours in (begin-end)
    try{
    System.out.println("\n\nTimeTestBegin");
    String begin=getVariableData("begin").toString();
    String end=getVariableData("end").toString();
    System.out.println(begin+"-----"+end);
    javax.xml.datatype.XMLGregorianCalendar beginTime = javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar(begin);
    javax.xml.datatype.XMLGregorianCalendar endTime = javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar(end);
    long diff=beginTime.toGregorianCalendar().getTimeInMillis()-endTime.toGregorianCalendar().getTimeInMillis();
    setVariableData("diff",String.valueOf(diff/1000/3600));
    System.out.println("DIFF======"+diff/1000/3600);
    System.out.println("TimeTestEnd");
    }catch(Exception e){
    e.printStackTrace();
    }

  • How can i calculate overtime hours with PCR?

    hi all,
    i was wandering, can i calculate overtime hours in this case?
    example my DWS for this day is 08.00 - 16.00
    i do early overtime from 06.00 - 08.00, and after my working hours is finished, i do late overtime from 16.00 - 19.00
    (in TIP it is separated in 2 rows)
    how can i calculate my total overtime with pcr? i want to use the total for another calculation..
    06.00 - 08.00 : 2 hours
    16.00 - 19.00 : 3 hours
    +
            total      : 5 hours.
    thx all..

    ZPRN    DVARSTPRSNT
    N      COLOP*
    Y     DOUTTPORIGS
    Y E  HRS=0     HRS=PNUM  ADDDB9066 COLOP*
    Y *  COLOP*
    THE ZPRN PCR WILL GET THE TOTAL NUMBER WORKING HRS IN TIME TYPE 9066
    Now we will write a pcr to get overtime details
          DVARSTDPRCL
    *    DVARSTHOLCL
    * 1  D HRS=D9066  HRS-S HRS?0
    * 1 * ADDDB9067
    * 1 < COLOP*
    0 *
    NOW THIS PCR WILL BRING THE OVERTIME
    BASED ON YOUR DAILY WORK SCHEDULES U NEED TO CHANGE VARSTDPRCL NOW MY RULES WILL WORK FOR ALL THE SHIFTS OTHER THAN WEEKLY OFFS
    REGARDS,
    RAJA SEKHAR.

  • How do I calculate a time such as work hours

    How do I calculate a time such as, a cell may have any time valve pertaining to daily work hours. 8:00 or 7:00 or 10:30. My question is I want another cell to represent any amount over 8:00. Like in a nine hour day you would have 8:00 with 1:00 overtime

    This may help:
    The first row is a header.
    select the three columns and format as  "Duration":
    now enter the formulas as:
    B2=IFERROR(IF(A2>DURATION(0, 0, 8), DURATION(0, 0, 8), DURATION(0, 0, 0)), "")
    C2=IFERROR(A2-B2, "")
    select B2 and C2, then fill down as needed

  • How do i calculate the quotient of two numbers?

    I'm working on a document in Numbers and cannot figure out how to calcate the quotient of numbers from two different columns?
    Thanks!

    "I tried doing this and I keep getting 0 or 2. There are no decimal places and I doubled check to make sure that my decimal place settings was on and it is."
    Correct.
    Re-read my post above for an explanation why this is the correct result. Both example in my table use the same dividend (8) and the same divisor (3). Both results in column C are correct for the function (QUOTIENT) or operator ( / ) used. Choose the function or operator that gives the result you expect.
    (Note: in Numbers 3, the division operator will display as ÷ )
    Also note Yvan's remarks comparing QUOTIENT and INT.
    Regards,
    Barry

  • How can I calculate the value of the cell, which depends on other rows?

    Hi, all!
    I have an application with table. In this table i have calculate some fields, that doesn't exists in data class and depends on other row values, e.g. current row number, or sum of previous rows. How can i calculate this values in TableView?
    The problem is that I have no information about the current row number in the cell value factory.
    Example:
    public class Transaction {
         public String getName();
         public BigInteger getAmount();
    } // There is no getter for "Balance"
    Result table should be something like this:
    Name
    Amount
    Balance
    transaction1
    300
    300
    transaction2
    200
    500
    transaction3
    500
    1000
    Also, after sorting by "Amount", "Balance" should be recalculated:
    Name
    Amount
    Balance
    transaction3
    500
    500
    transaction1
    300
    800
    transaction2
    200
    1000

    Strings can be converted to numbers by various parse methods. For instance Strings can be converted to double via Double.parseDouble(myString).
    That being said, it appears that your textfield will contain numbers and operators, and so these operators will need to be parsed too. I would advise you to search on the terms Java infix postfix.

  • How do I calculate fuel consumption?

    Hello
    As a long-time newbie to Numbers 2.1, I came across a long-term problem I haven't been able to solve:
    How do I calculate the fuel-consumption of my car based on refuel-amount and mileage indicator?
    I think I should do as follow:
    purchased_fuel / (recent_mileage - previous_mileage), but I don't find a clue to do an automated (recent_mileage - previous_mileage) in Numbers!
    Any help?
    Thanks!

    Here is a table that perfroms the math to compute MPG (Miles Per Gallon):
    D3=(C3-C2)/B3
    this means in cell D3 type (or paste from this post) "=(C3-C2)/B3" without the double quotes
    to "expand" the formula, more properly known as fill then formula, select the cell D3, grab (click and hold) the little circle at the bottom-right of the cell and drag down as shown.  One comment I have is that my car has a an odometer and two trip counters (A and B). I use "B" to keep track of mileage since the last fillup so rather than typing Odometer readings in I type the trip mileage.
    In this case you would change the name of column C and the formula would be:
    D3=C3/B3

  • How to add two different page numbers in a single page

    How to add two different page numbers in a single page? One is for page number of the whole article, the other one is for page number for each chapter in the article.

    It's quite complicated, see
    Two Page Numbering Schemes in the Same Document.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • How can I get the phone numbers in contacts to appear with dashes between the first 3 numbers, the next 3 numbers, and the last 4 numbers?  Until very recently it did so.  Contacts on my macbook pro does show up this way.  I do have a mobile me account an

    How can I get the phone numbers in contacts to appear with dashes between the first 3 numbers, the next 3 numbers, and the last 4 numbers?  Until very recently
    it did so.  Contacts on my macbook pro does show up this way.  I do have a mobile me account and in the past syncing was no problem.  What setting has changed?

    The phone number format as well as the date language and format and the time format are controlled by the Region Format setting. Go to Settings > General >International > Region Format.  When you change a region format, you can go back one page (to International) and see an example of the date/time/phone number format that your selected region format will produce.

  • HT204053 how do i move page and numbers documents from one icloud login to another?

    how do i move page and numbers documents from one icloud login to another?
    I had to change my email address whcih meant new apple login.
    I have a number of docs in iwork/pages and iwork/numbers.  How do I transfer them to my new login?

    There's a couple of ways but my tip backing up your documents in the cloud is as good as any.

Maybe you are looking for

  • How to use shortcut keys on wireless keyboard with ipad

    i just purchased an ipad 4 with a wireless keyboard and do not know how to use the function keys on the wireless keyboard to access the homescreen, scroll up and down, etc.  please help with anything i need to turn on/off or download . thanks

  • Garbled order when photos transferred to IPhone

    I have a file of photos on my computer which are viewed sequentially in name order - topic 1.jpg, topic 2.jpg, etc. They transfer fine to the IPhone, but the order is garbled so the slide show on the IPhone doesn't show in the correct sequence. How c

  • Clean way to disable integrated webcam, but not USB webcam?

    In an old (and now closed) thread, two solutions for disabling webcams were discussed: 1. unload the matching module 2. remove permissions of /dev/video0 The first has the disadvantage of disabling all webcams (not just the internal one), the second

  • ITunes on Windows Vista and audio CDs

    I just downloaded the new version of iTunes for Windows Vista. I actually tried this before the new version came out and my audio CDs wouldn't play correctly. I tried everything in the article "Audio does not play or plays incorrectly" and it didn't

  • Excel files become distorted

    Hi, I have w-7 64 bit os at my office and w-7 32 bit at my home. when ever i open some excel files they become distorted in layout. every time i need to rearrange their lay out. how to avoid this ? please help. thanks,