+ Reply to Thread
Results 1 to 3 of 3

Show contents of cel to the left of the max of these specific non-contiguous cells

  1. #1
    Registered User
    Join Date
    04-23-2008
    Posts
    2

    Cool Show contents of cel to the left of the max of these specific non-contiguous cells

    Basically, I have a huge table of data that looks like:

    Item Name 1 - Price 1 - Quantity Stock 1 - Quantity Sold 1 - Item name 2 - etc

    it goes out to item 15 or so at column DZ. I've been able to find the max of the 15 prices pretty easily (=MAX(B2,F2,J2,etc).

    The problem comes when I want to see what the Quantity Sold at that Max Price is. The formula I have come up with fails wherever the value of that Max Price cell is also shared with any other cell in the range. I've been unable to figure out how to search only those specific Price cells. It seems I've gotta do a contiguous range, which is not really possible. The formula I've got is:

    =OFFSET(INDIRECT(CELL("address",INDEX(C2:DZ2,MATCH(A2,C2:DZ2,0)))),0,2)

    A2 there would be the MAX from the other formula.

    So, the overall idea is to locate the max price and plug that into cell A2, then locate the data 2 cells to the right of that max price and plug that data back into cell B2 so I've got the max price and the qty sold at that price right next to each other.

    So, right now I'm getting screwed up wherever Max Price = Quantity Stock or Quantity Sold. The formula apparently just takes the first instance of the match it comes across. From what I've read, the MATCH function doesn't allow you to designate specific cells to search--only a contiguous range.

    Any help would be greatly appreciated!

    Thanks!

  2. #2
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    Assuming that C1:DZ1 contains the headers, and C2:DZ2 contains the data, try...

    A2, confirmed with CONTROL+SHIFT+ENTER:

    =MAX(IF(C1:DZ1="Price",C2:DZ2))

    B2, confirmed with CONTROL+SHIFT+ENTER:

    =INDEX(C2:DZ2,MATCH(A2,IF(C1:DZ1="Price",C2:DZ2),0)+2)

    Note that if there's two or more items tied with having the maximum price, the corresponding quantity for the first occurrence will be returned.

    Hope this helps!

  3. #3
    Registered User
    Join Date
    04-23-2008
    Posts
    2
    Awesome, man. That worked. Thanks a lot!

+ 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