+ Reply to Thread
Results 1 to 7 of 7

How to find value >0 and return content of adjacent cell...

Hybrid View

  1. #1
    Registered User
    Join Date
    07-16-2014
    Location
    Virginia
    MS-Off Ver
    Office 2010
    Posts
    7

    How to find value >0 and return content of adjacent cell...

    I need to have a formula that will look at 24 specific cells to find the one whose amount is >0. I can get that part, but what I want to return in the cell is the value in the cell ADJACENT to the one that is >0.

    I started with an IF OR formula (currently only showing 5 cell options for brevity) but I'm open to suggestions: =IF(OR(A1>0,A2>0,A3>0,A4>0,A5>0),B1,0)

    Where I have "B1" is where I need to fill in something that will make it read the adjacent of the pertinent cell, ie - if A3 is the one with the value greater than 0, then the value of B3 is what will be returned.

    Have I explained this right? Anyone have any ideas?

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,082

    Re: How to find value >0 and return content of adjacent cell...

    If column B are all numbers this should work

    =SUMPRODUCT((A1:A24>0)*(B1:B24))

    Update: This will return ALL values where column A > 0, this may not be what you want
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    07-16-2014
    Location
    Virginia
    MS-Off Ver
    Office 2010
    Posts
    7

    Re: How to find value >0 and return content of adjacent cell...

    =SUMPRODUCT((A1:A24>0)*(B1:B24)) worked great and allowed me to sub in any column or row into either portion of the formula, so long as both were either row or column (not one of each). I appreciate the advice!

  4. #4
    Registered User
    Join Date
    11-19-2019
    Location
    Europe
    MS-Off Ver
    Office 365 ProPlus
    Posts
    32

    Re: How to find value >0 and return content of adjacent cell...

    Quote Originally Posted by Special-K View Post
    If column B are all numbers this should work

    =SUMPRODUCT((A1:A24>0)*(B1:B24))

    Update: This will return ALL values where column A > 0, this may not be what you want
    Can someone tell me if they have a formula that work when column B are texts?

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: How to find value >0 and return content of adjacent cell...

    Quote Originally Posted by Enounce View Post
    Can someone tell me if they have a formula that work when column B are texts?
    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: How to find value >0 and return content of adjacent cell...

    Try this Array Formula. Hold Control + Shift and press Enter to enter this formula as an Array

    =INDEX(B1:B24,MAX(--(A1:A24>0)*ROW(1:24)))

    (Edited formula)

    This formula assumes only one cell at a time in the range will be greater than Zero
    Last edited by Speshul; 08-18-2014 at 11:39 AM.
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  7. #7
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: How to find value >0 and return content of adjacent cell...

    Assumptions:

    1) the cells are a contiguous range, eg, A1:A24 for the test range, and the return range is adjacent to it, eg B1:B24


    2) There is one-and-only-one cell that is more than zero

    =INDEX(B1:B24, MATCH(MAX(A1:A24), A1:A24, 0))
    Note than since it's looking for the maximum value to start with, if the range is from -25 to -1, then it will return the value corresponding to -1; and if it's {-25, ..., 0, 1, 5} then it will return corresponding to 5 despite there being more than one value >0.

    Are the error modes for the data going to present a problem?

+ 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 next non blank cell in list and return value from adjacent column
    By kristy.brown in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-19-2014, 03:28 PM
  2. Find Value in index and return adjacent cell
    By t2tommy in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-09-2013, 01:22 PM
  3. Search for specific value in a row, then return content og adjacent cell
    By linaudio in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-20-2013, 09:11 AM
  4. Find text in array & return adjacent cell value
    By econbizer in forum Excel General
    Replies: 13
    Last Post: 10-13-2012, 01:26 AM
  5. Find and Match Text in Column Return Adjacent Cell
    By biancam in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-11-2012, 02:45 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