+ Reply to Thread
Results 1 to 3 of 3

Search in cell defined by formula

Hybrid View

  1. #1
    Registered User
    Join Date
    05-26-2015
    Location
    Copenhagen
    MS-Off Ver
    2010
    Posts
    28

    Search in cell defined by formula

    Hello there,

    i got a relatively simple issue but i can't quite figure out how to solve it.

    I am currently using the formula:

    =INDEX('EX22'!$M:$M;MATCH($A$2;'EX22'!$A:$A;0)+1)

    Basically, what it does is that it looks in a big Data sheet called EX22. It looks for the value i defined in cell A2. Afterwards it finds me the value in the same row in column M:M, and give me the value one row down (last part, +1).

    What i want to do is that the 'EX22'!$M:$M part can somehow be written as a "formula". I don't always want to look in M:M. The location which i want to retrieve the value in depends on another parameter
    where i know the column number (M being column 13, going from column 5 (E), to column 20 (T).

    Instead of manually writing: 'EX22'!$M:$M in the formula i want to write 'EX22'!$char(A3+64):$char(A3+64)
    Where A3 would be the cell i define the column in.
    I know that the above example wouldn't work as excel doesn't really work that way.

    So my question is:
    Does anyone have a suggestion as to how this could be done?

    Any help is greatly appreciated.

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

    Re: Search in cell defined by formula

    You'r pretty much there, you need to use INDIRECT()
    Try (untested)

    =INDEX(INDIRECT("'EX22'!"&CHAR(A3+64)&":"&CHAR(A3+64));MATCH($A$2;'EX22'!$A:$A;0)+1)

    NOTE: Be careful if your columns go past 26, your calculation will not return column 27 as AA
    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
    05-26-2015
    Location
    Copenhagen
    MS-Off Ver
    2010
    Posts
    28

    Re: Search in cell defined by formula

    Bingo!
    I've never actually used the indirect formula before but i suspect i ll be using it more in the future.

    Thanks alot for the help.

+ 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] extend search formula to mutiple search for single a cell
    By lagiosman in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-20-2014, 01:16 PM
  2. Replies: 4
    Last Post: 03-15-2014, 11:01 PM
  3. Search within a cell for multiple defined terms
    By fstone33 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-05-2012, 11:09 AM
  4. Replies: 5
    Last Post: 03-29-2012, 04:12 AM
  5. Application-defined or Object-defined error on Formula entry
    By Kaigi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2009, 01:33 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