+ Reply to Thread
Results 1 to 5 of 5

finding rows that contain a data string across mutiple columns

Hybrid View

  1. #1
    Registered User
    Join Date
    06-01-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    3

    finding rows that contain a data string across mutiple columns

    Hi,

    Wonder if you can help? I have a spreadsheet containing one physical address and multiple email addresses on each row. There are 7000 rows each with up to 260 email addresses and physical address. On a seperate tab I have 140 email addresses and I want to know to which columns on the first data tab they refer.

    I know that If I had one email address on the first sheet that I could use a standard VLOOKUP function, but I can't find a way to search across the 260 columns to see if any of them contain the email address in the second tab.

    Any suggestions?

  2. #2
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    365
    Posts
    2,243

    Re: finding rows that contain a data string across mutiple columns

    Hi,

    I am not sure I fully understood.

    Consider in Sheet1 A2 to down you have email addresses to find the column numbers.
    Sheet2!A2:IZ1000 contains the data both addresses & email addresses.

    If so try this in Sheet1!B2, with CTRL+SHIFT+ENTER,

    =MATCH(A2,INDEX(Sheet2!$A$2:$IZ$1000,SMALL(IF(Sheet2!$A$2:$IZ$1000=A2,ROW(Sheet2!$A$2:$A$1000)-ROW(Sheet2!$A$2)+1),1),0),0)

    Then copy down.
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  3. #3
    Registered User
    Join Date
    06-01-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: finding rows that contain a data string across mutiple columns

    Hi Haseeb,

    Apologies that I did not make myself clear! and Thank you for your suggestion.

    To try and clarify what I am seeking to achieve, I have created a sample spreadsheet that represents the (large) sheet I am working on. See attached.

    What I want to do is to lookup across the range of email addresses in sheet 1 and when the email address is found, it returns the column reference in the A column into Sheet 2 column B.

    Once I have the Column Reference associated with an email address I'm sorted.

    Does that many any more sense?

    Thanks,
    Simon
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    365
    Posts
    2,243

    Re: finding rows that contain a data string across mutiple columns

    Try this with CTRL+SHIFT+ENTER, rather than just ENTER in B2, then copy down.

    =IFERROR(ADDRESS(SMALL(IF(Sheet1!$B$2:$F$20=$A2,ROW(Sheet1!B$2:B$20)),1),SMALL(IF(Sheet1!$B$2:$F$20=$A2,COLUMN(Sheet1!B$2:F$2)),1),4),"N/A")

  5. #5
    Registered User
    Join Date
    06-01-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: finding rows that contain a data string across mutiple columns

    Thanks again Haseeb.

    When I implement this formula into my data, It returns me results but the row number is either 4 or 8 rows adrift from where it should be. Is there anything in the formula that could be causing this, or have I messed up?

    Thanks,
    Simon

+ 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