+ Reply to Thread
Results 1 to 10 of 10

Run a search using a value in the cell above

  1. #1
    Registered User
    Join Date
    04-17-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    16

    Run a search using a value in the cell above

    Hey,

    I'm trying to run a search through some cells for a value located above the cell that has the search function.

    I'm trying to use this:
    =ADDRESS(2;MATCH(A5;A1:UX1;0);4)

    Where A5 is where I have a number which I want to search for.
    I also tried this instead of A5:

    =ADDRESS(2;MATCH(INDIRECT(ADDRESS((ROW()-1);COLUMN();4));A1:UX1;0);4)

    But also didn't work.
    However, if I replace it for a number, the search function works. How come?

    Thanks

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Run a search using a value in the cell above

    this formula

    =ADDRESS(2;MATCH(A5;A1:UX1;0);4)

    should work, could you attach the workbook? maybe there is somethign in the data.
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Registered User
    Join Date
    04-17-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Run a search using a value in the cell above

    Good catch. The problem seems to be hierarchy.

    Let's say on A2 I have: "28v".
    On A3 I have this: "=(LEFT(INDIRECT(ADDRESS((ROW()-1);COLUMN();4));(LEN(INDIRECT(ADDRESS((ROW()-1);COLUMN();4)))-1)))" - crops 28v to 28.
    On A4 I have this: "=ADDRESS(2;MATCH(A3;A1:UX1;0);4)"

    It seems that the last function is somehow executed before the first one because if I change A3 manually to 28, then it works without problem.

    Any idea how to fix this?

  4. #4
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Run a search using a value in the cell above

    could you attach a sample?

  5. #5
    Registered User
    Join Date
    04-17-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Run a search using a value in the cell above


  6. #6
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Run a search using a value in the cell above

    i cannot access that due to firewall... can you please attach using the advanced edit mode here?

  7. #7
    Registered User
    Join Date
    04-17-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Run a search using a value in the cell above

    Of course, thanks for your time.
    Attached Files Attached Files

  8. #8
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Run a search using a value in the cell above

    ahh ok i get it now, it needs to be converted to a number, try adding +0 to the end like this:

    =(LEFT(INDIRECT(ADDRESS((ROW()-1),COLUMN(),4)),(LEN(INDIRECT(ADDRESS((ROW()-1),COLUMN(),4)))-1)))+0

  9. #9
    Registered User
    Join Date
    04-17-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Run a search using a value in the cell above

    Excellent, it fixed the problem.

    Thanks a lot for your time and attention DGagnon, have a rest of a good day.

  10. #10
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Run a search using a value in the cell above

    no problem, you too.

+ 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