+ Reply to Thread
Results 1 to 9 of 9

Function to return MAX value for a range

Hybrid View

  1. #1
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Function to return MAX value for a range

    I can't get my brain around which function to use use to return the largest number in a range of cells(E2:CA2) and show the result in CG2.

    I thought about IF and MAX functions, but I'm unsure if I'm even using them correctly or not. I'm tired of wasting hours on this simple problem and need some help.

    I've attached a worksheet so you can see what I'm up against.

    The employees earn a cash bonus for every 30 days of working safely or not having a safety violation ($25 for 30 days, $30 for 60 days, $35 for 90 days, and $40max for 120 days or more)

    BTW, The employee names and clock numbers are linked to another workbook so if they don't show up for you that is why.
    Attached Files Attached Files
    Last edited by jwright650; 02-08-2011 at 11:14 AM. Reason: Solved with correct data type
    Life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
    John Wright

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Function to return MAX value for a range

    Why not just?

    =MAX(E2:CA2)

    Actually, it looks like the formulas in E:CA are text results.... the formulas should not have numbers in quotes. i.e. =IF($**$2-D2>=30,"25","0") should be =IF($**$2-D2>=30,25,0)

    You should fix them...

    otherwise you need to coerce them to numbers with: =MAX(E2:CA2+0) confirmed with CTRL+SHIFT+ENTER not just ENTER

    or =SUMPRODUCT(MAX(E2:CA2+0))

    and copied down.
    Last edited by NBVC; 02-08-2011 at 09:59 AM.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Function to return MAX value for a range

    Quote Originally Posted by NBVC View Post

    =MAX(E2:CA2)
    I tried that but it returns $0 even when the employee has $40 showing for several months....I've tried so many combinations that I've become very confused...thus I needed you guys to help me out.

  4. #4
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Function to return MAX value for a range

    Quote Originally Posted by NBVC View Post
    Actually, it looks like the formulas in E:CA are text results.... the formulas should not have numbers in quotes. i.e. =IF($**$2-D2>=30,"25","0") should be =IF($**$2-D2>=30,25,0)
    Ahhhh, I need to look at that for a minute....this was created many, many years ago and now i'm trying to get back in there and fix a few things.


    edit: I'm going to fix the values and then try the MAX formula again to see how that works...<heads off to repair worksheet>
    Last edited by jwright650; 02-08-2011 at 10:19 AM. Reason: added comment

  5. #5
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Function to return MAX value for a range

    Also....Sheet2 is just a report for the secretary so she can make sure the employee gets the correct $ in their envelope. I was trying to automate that for her by referencing the CG column on Sheet1

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,122

    Re: Function to return MAX value for a range

    It might be a stupid question, but what is "MAXA"?

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  7. #7
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Function to return MAX value for a range

    Quote Originally Posted by TMShucks View Post
    It might be a stupid question, but what is "MAXA"?

    Regards
    Not a silly question....

    Quote Originally Posted by excel2003
    MAXA


    See Also
    Returns the largest value in a list of arguments. Text and logical values such as TRUE and FALSE are compared as well as numbers.
    MAXA is similar to MINA. For more information, see the examples for MINA.
    Syntax
    MAXA(value1,value2,...)
    Value1, value2, ... are 1 to 30 values for which you want to find the largest value.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Function to return MAX value for a range

    See my ammendment above.

  9. #9
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Function to return MAX value for a range

    Life is all good again...all solved....LOL

    MAX formula works correctly now that the data is the correct type.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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