+ Reply to Thread
Results 1 to 4 of 4

Need Max(Cell Range) to stay the same

  1. #1
    Registered User
    Join Date
    07-28-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Question Need Max(Cell Range) to stay the same

    I play a war game and rather then try and do a lot of math in my head, I'm working up a spreadsheet I can pass around to my friends that can be easily updated to show the best unit to use in battle for attack and defense. I'm having a little trouble with my function. As follows:

    Column A = Names (User Input)
    Column B = Attack (User Input)
    Column C = Defense (User Input)
    Column D = Current # of Unis (User Input)
    Column E = Output Value of X (will be locked awaiting function)
    Column F = Output Value of Y (will be locked awaiting function)

    Now my function looks like so:
    =IF(MAX(B4:B10)=B4,VALUE(D4),"Don't Use") - works fine.
    Unfortunately, when trying to auto fill down I get:
    =IF(MAX(B5:B11)=B5,VALUE(D5),"Don't Use") - Does not maintain MAX(Cell Range) when auto filled or "Insert Row" feature is used.

    I've even tried setting up 2 or 3 rows to show the cell that the MAX(Cell Range) is not changing and then auto-fill down but it still begins to change the the cell range.

    i need the function to keep the same MAX(Cell Range), while verifying weather or not to output the Column D value or "Don't Use Value" so that when they use the "Insert Row" feature, it will update the proper MAX(Cell Range). I can do it all manually, but I'm trying to avoid a billion questions on how to manually update the excel ranges. any tips are appreciated.

    thx.

  2. #2
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    New England
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    554

    Re: Need Max(Cell Range) to stay the same

    Anchors!

    You can anchor a particular range, or portion of a range using the $ symbol. This allows for easier use for copying down, etc.

    For example... if you're copying down your equation: (Down 1 row)
    =IF(MAX(B4:B10)=B4,VALUE(D4),"Don't Use")
    Normally, as you referenced, it would be:
    =IF(MAX(B5:B11)=B5,VALUE(D5),"Don't Use")

    If you anchor the row values of the maximum, such as:
    =IF(MAX(B$4:B$10)=B4,VALUE(D4),"Don't Use")
    Auto-filled down to the next row, the equation will be:
    =IF(MAX(B$4:B$10)=B5,VALUE(D5),"Don't Use")

    You can also do anchors on the columns, although that is not relevant for the current problem.


    Alternatively, although considered poor practice for using excessive computing power which may result in calculation delays on older computers, you can use just the column reference for the maximum. Since the blank cells are null, they will not be taken into account with the Max statement:
    =IF(MAX(B:B)=B5,VALUE(D5),"Don't Use")
    Going for Guru! Click the Star to the bottom left of this post if I helped!

  3. #3
    Registered User
    Join Date
    07-28-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Thumbs up Re: Need Max(Cell Range) to stay the same

    Ah! Ty so very much. I'm limited and you just made me a little smarter! You're getting helpful points for thi1 1! Good Job and ty again.

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Need Max(Cell Range) to stay the same

    Have a look at XL help about absolute and relative references ( and the use of the F4 key) for more info

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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