+ Reply to Thread
Results 1 to 11 of 11

Find MAX in range and display value of the top cell in column

  1. #1
    Forum Contributor
    Join Date
    08-10-2014
    Location
    Alberta
    MS-Off Ver
    2016
    Posts
    128

    Find MAX in range and display value of the top cell in column

    I have to admit that I am lost to how this could be done. I have a worksheet with names in column 1 that will go down at least by 5000 rows (within the next 5 years). I then have a range of 39 columns (from column K to AW) that gets checked every time the name is entered more than once. In that range, the top cell has a different value and is always the same (they are room numbers).

    What I want is to find the MAX in a row within the range and then enter into a cell which column has the highest value. So, say there is Bob in row 5, I want to find the maximum value in range K5:AW5. Say column L (a value of 3 let's say) has the highest value with 8, I want 3 to be placed in cell(5,9). If column P has the highest value with 10, I want to place 7 in cell(5,9).

    *Further info if needed
    How the names get entered is through a userform. People enter the name and the room number. Every time a name gets entered, it searches for the name in column 1 and then adds 1 to the room number they are entering. The first time they get entered their name gets placed in column 1 and other statistics gets placed as well. If need be I could place a formula here to have MAX entered into column 9.
    Variables in userform:
    The variable for name is: GuestName
    The variable for the room is: Roomnum

    I thought I could do something like this in the userform:
    Please Login or Register  to view this content.
    Then in the worksheet change function, it can match Cell(Tot,10) and to the number in the range and place in column 9 the value for the top of the cell.
    Last edited by Templemind; 12-01-2014 at 07:48 AM. Reason: added code

  2. #2
    Forum Contributor
    Join Date
    08-10-2014
    Location
    Alberta
    MS-Off Ver
    2016
    Posts
    128

    Re: Find MAX in range and display value of the top cell in column

    Am I not explaining myself correctly or can this be done?

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Find MAX in range and display value of the top cell in column

    Atleast share a screenshot if possible


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Forum Contributor
    Join Date
    08-10-2014
    Location
    Alberta
    MS-Off Ver
    2016
    Posts
    128

    Re: Find MAX in range and display value of the top cell in column

    This is the screenshot of the worksheet:
    Untitled.jpg

    This is a screenshot of the userform:
    Untitled2.jpg

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Find MAX in range and display value of the top cell in column

    Replace this line

    Please Login or Register  to view this content.
    With

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    08-10-2014
    Location
    Alberta
    MS-Off Ver
    2016
    Posts
    128

    Re: Find MAX in range and display value of the top cell in column

    Thank you. I just need to find out how to match the two cells to come out with the top of the column. Any ideas?

  7. #7
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Find MAX in range and display value of the top cell in column

    Quote Originally Posted by Templemind View Post
    find out how to match the two cells to come out with the top of the column. Any ideas?
    Little bit confused about the words "Two Cells"

    "Two Cells" Refers to?

  8. #8
    Forum Contributor
    Join Date
    08-10-2014
    Location
    Alberta
    MS-Off Ver
    2016
    Posts
    128

    Re: Find MAX in range and display value of the top cell in column

    Sorry. the cell of the max value and cell 10 of the same row (the outcome of the previous formula). So for row 15, column 101 (at the top of the column) has 2, which is the largest in that row. Thus 101 would be put in cell(15, 9).
    Untitled.jpg

    I guess I should add that this doing any kind of calculation on change would not be taxing on the program as it would only be looking at one row per change, even if there were 20,000 names. A loop would not work as it would have to search through all of the rows for those 39 columns each, but the worksheet would only change when someone entered a name with the userform.
    Last edited by Templemind; 12-01-2014 at 10:08 AM.

  9. #9
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Find MAX in range and display value of the top cell in column

    Try this...

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    08-10-2014
    Location
    Alberta
    MS-Off Ver
    2016
    Posts
    128

    Re: Find MAX in range and display value of the top cell in column

    That works. Thank you. It will take me a bit to fully understand the formula. I was totally lost.

  11. #11
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Find MAX in range and display value of the top cell in column

    Quote Originally Posted by Templemind View Post
    It will take me a bit to fully understand the formula. I was totally lost.
    I added comment for each line for your easy understanding

    Please Login or Register  to view this content.

+ 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] Find value in column, and display ajacent cell
    By Chris.Fadden in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 12-24-2013, 12:04 PM
  2. Replies: 5
    Last Post: 10-08-2012, 05:42 AM
  3. If text mathces column 1 range, display value in column 2 cell
    By brillison in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-03-2008, 03:59 PM
  4. [SOLVED] HOW? Find and display the last cell in a column with a value > 0
    By Conker10382 in forum Excel General
    Replies: 10
    Last Post: 07-21-2006, 09:05 PM
  5. [SOLVED] VBA code using Find to locate text and display the Cell Range.
    By slimla in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-27-2005, 05:05 PM

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