+ Reply to Thread
Results 1 to 10 of 10

Calculation formula greater than less than

  1. #1
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Calculation formula greater than less than

    Hi Experts,
    I'm looking formula in D column to calculate according the criteria, Example:

    In this example I need Cell D2 to be:
    -up to the first 40 hours is $10.00 per hour in this example -anything over 40 hours (7 in this example) is paid 1.5 times the hourly pay of $10
    -So the total for cell D2 needs to be: (40*10)+(7*15)=505


    I want the same formula for cell D2 that will work in D3 as well where there is no amount over 40 hours. So D3 will be (36*11)+(0*16.5)=396

    Thanks in Advance.
    gul
    Attached Images Attached Images

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Calculation formula greater than less than

    Try this. Next time I recommend attaching a file so we can put your formula right in the file.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: Calculation formula greater than less than

    Hi 65string, Thanks for help, but result is not correct, when I put your formula in 1st it is showing 575 but it would be 505

  4. #4
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: Calculation formula greater than less than

    In this example I need Cell D2 to be:
    -up to the first 40 hours is $10.00 per hour in this example -anything over 40 hours (7 in this example) is paid 1.5 times the hourly pay of $10
    -So the total for cell D2 needs to be: (40*10)+(7*15)=505


    I want the same formula for cell D2 that will work in D3 as well where there is no amount over 40 hours. So D3 will be (36*11)+(0*16.5)=396

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Calculation formula greater than less than

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  6. #6
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: Calculation formula greater than less than

    Sorry, here is Sample excel file
    Attached Files Attached Files

  7. #7
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Calculation formula greater than less than

    Small typo in 6SJ's formula - the first function should be MIN not MAX:

    =MIN(B2,40)*C2 + (MAX(B2-40,0))*1.5*C2

    Note: the 505 in your example workbook makes no sense since there are 58 hours.
    Rory

  8. #8
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Calculation formula greater than less than

    Please explain your example
    in B2 the total hours are 58. So 40 regular hours at 10 =400.
    Ouverhours =58-40=18 and 18*15=270
    Total = 670
    Where do you get the 7 overhours instead of 18???
    Attached Files Attached Files

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Calculation formula greater than less than

    Both of your expected answers look as though they are incorrect!! This makes it rather difficult.... to say the elast.

    please check and amend.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  10. #10
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: Calculation formula greater than less than

    Thanks rorya, you are Expert.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Calculation if greater than 8
    By AaruJaan in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-02-2019, 04:14 PM
  2. Replies: 1
    Last Post: 04-02-2016, 04:32 AM
  3. Replies: 4
    Last Post: 01-10-2014, 09:32 AM
  4. Replies: 5
    Last Post: 04-02-2013, 02:25 PM
  5. Replies: 3
    Last Post: 07-11-2012, 11:00 AM
  6. Replies: 2
    Last Post: 01-17-2012, 09:17 AM
  7. Replies: 6
    Last Post: 07-01-2005, 07:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1