Welcome to iPadForums.net Guest - Click Here to Register

Please help with an "if" question

This is a discussion on Please help with an "if" question within the iWork Forum forums, part of the iPad App Store category; Hello all I apologies if this is a simple question regarding formulas. I am new to "numbers" and have never used excel. I need to ...

Register with iPad Forums
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    iPF Noob
    Member #
    146176
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1

    Please help with an "if" question

    Hello all

    I apologies if this is a simple question regarding formulas. I am new to "numbers" and have never used excel. I need to write a formula that will do this:

    John works 9 hours at $15/per hour. If John works more than 5 hrs but less than 8 he takes a half hours break (not paid) if he work more than 8 hours he takes an hour break (not paid for)

    I need a cell to calculate his pay at the end of his shift.

    I am learning as fast as I can but these "if" formulas are a little tricky for me.

    If someone could kindly help me I think I can work out the rest from your example.

    Thank you very much

  2. Ads


  3. #2
    iPF Legend
    Member #
    28530
    Liked
    579 times
    Join Date
    Jan 2011
    Location
    Dayton, WA
    Posts
    13,188
    It was a bit of a challenge, but fun. Hope I'm not doing someone's homework, because figuring these things out is half the lesson.

    Anyway, the illustration is not entirely clear, so here are some things to hold in mind.

    The IFERROR is a wrapper in case the basic equation gives back an error. This happens when the Wk Hr cell is empty. I'm not certain but I believe it is the DUR2HOURS function that does this. It is not the usual dived by zero problem, because an entry of zero in the Wk Hr cell clears the error.


    You can make the formula simpler by not formatting the Wk Hr column as duration as I did; but that means you have to remember to enter your work time in decimal. 1h 30m = 1.5. If you do use Duration as I did, you have to convert it to a decimal value before you test it or use it to compute the Pay. That makes for a lot of DUR2HOURS functions.

    There are probably ways to compare the durations directly, but it looked like they would only add another function without lessening the complication of the final formula.

    It requires two IF statements, the second nested in the if-false expression of the first. The first tests for the least case, equal too or less than 5 hr. If it is true you get a simple 15 x hr computation. If false you still have two cases to differentiate, so you need the second if statement. You don't have to test for less than or equal to 5 again, if it were true you'd already computed the answer.

    In the second (nested) IF statement you test whether the Wk Hr are less than or equal to 8. If so you subtract the 30 minutes (.5 hours) from the total hours then multiply by 15.

    Anything else will obviously be greater than 8 hours, so in the if-false expression of the nested IF statement you subtract 1h from the total and multiply by 15.

    I did a casual test to see if the formula worked (which is why I ended up adding the error wrapper), but I did not rigorously test for all possible inputs. For instance, I did not try to see what would happen if I entered a negative number.

    Hopefully this plus the illustration should be enough for you to figure out what is going on. Don't miss the manually entered parentheses. They are necessary to get the right results.
    Attached Thumbnails Attached Thumbnails Please help with an "if" question-wkhrpayequation.jpg   Please help with an "if" question-wkhrpayequation_2.jpg  
    Last edited by twerppoet; 01-04-2012 at 10:03 PM. Reason: Add second attachment for clear view of formula.


Home | Forum | Active Topics | What's New

Advertisements

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Similar Threads

  1. Any other games like "Words with Friends" or "Pirate Battle?"
    By Lend27 in forum iPad General Discussions
    Replies: 7
    Last Post: 03-21-2012, 06:30 PM
  2. Teamviewer Hd app "open in" function question
    By Greygoose_ipad in forum iPad 2 Forum
    Replies: 0
    Last Post: 12-21-2011, 11:06 PM
  3. Replies: 4
    Last Post: 10-27-2011, 12:45 PM
  4. A question about an app called " notability "
    By Ayrshire in forum iPad Apps
    Replies: 7
    Last Post: 07-13-2011, 04:54 AM
  5. Question about "Return Policy"
    By High Plains Drifter in forum iPad General Discussions
    Replies: 7
    Last Post: 05-03-2010, 02:28 PM

Search tags for this page

apple numbers nested if statements

,

how to use if in ipad number

,

if formula in iwork numbers

,
iwork cell format doesn't work
,

iwork numbers if function

,
iwork numbers test if cell has number
,
nested if function, hours worked & breaks
,

nesting an iferror statement in an if statement

,

nesting functions iworks suite

,

numbers iworks nesting if conditions

,

numbers mac using multiple if

,

writing if statements in numbers ipad

Click on a term to search for related topics.