+ Reply to Thread
Results 1 to 18 of 18

Search from every row of column in a column and return row number

  1. #1
    Registered User
    Join Date
    09-03-2008
    Location
    Slovakia
    Posts
    20

    Search from every row of column in a column and return row number

    how to find text from a row in column, where is a lot of text and return row number, of located text?

    Thank you
    Last edited by oldchippy; 10-23-2008 at 04:29 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Your question is not clear... perhaps post a sample showing what you need.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    Perhaps something like this?
    Attached Files Attached Files
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  4. #4
    Registered User
    Join Date
    09-03-2008
    Location
    Slovakia
    Posts
    20
    Quote Originally Posted by NBVC View Post
    Your question is not clear... perhaps post a sample showing what you need.
    well, in A column I have logins (every row = other login name) and in C column I have messages - long text (every row = new message), where I need to find these logins. And the return value in B column should be for example a number of line, in which the login would be found.


    Please Login or Register  to view this content.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    So what are your inputs?

    Give an example of the inputs and what output is expected from you sample above.

  6. #6
    Registered User
    Join Date
    09-03-2008
    Location
    Slovakia
    Posts
    20
    column A and column C is input and B is output like on example.. output is the only number of row where the login is located. It is complete example

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Maybe?

    Please Login or Register  to view this content.
    where X1 and X2 contain input values...

    Adjust the ranges to suit your data and then confirm the formula with CTRL+SHIFT+ENTER not just ENTER... you will see { } brackets appear around it.

  8. #8
    Registered User
    Join Date
    09-03-2008
    Location
    Slovakia
    Posts
    20
    It hasn't worked
    I am not sure that you clearly understand me, maybe my english is very bad :P so I try it one's more:
    I have a report from security scan of servers, and I inserted 2 columns A,B as you can see on example. Into first column I have added logins that I need to find in error messages that are in column C. And B column that I have inserted is for output where should be the number of row with login, that would be found in error message (column C). For example when login ROMAN is founded in 10 error messages, the number or row with login ROMAN (in our case row 2) will be in front of every error message (in column B). You know, there are thousands of messages and then when I use autofilter, I will be able to see, which login is in which couple of messages

  9. #9
    Valued Forum Contributor
    Join Date
    08-26-2008
    Location
    singapore
    Posts
    626
    you need to explain more clearly.

    Is the columnB in your sample the exactly correct output you want?
    If yes, tell us why the number should be that

  10. #10
    Registered User
    Join Date
    09-03-2008
    Location
    Slovakia
    Posts
    20
    yes, the example is completeted imagination.. column B on my sample is, what I really need to. And the numbers in column B are numbers of lines in which is login name. For example login ROMAN is on the second line so number 2 should be in front of every message, where login ROMAN really is.
    ("In front of" - because B column is in front of C column)

  11. #11
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    It almost sounds like putting =ROW() in your column B cells would do what you want.
    If that isn't it, could you attach an example of the kind of data you have and the result you want?
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  12. #12
    Registered User
    Join Date
    09-03-2008
    Location
    Slovakia
    Posts
    20
    no because it is confidential. well.. I think that sample is good and not so hard to understand.. the point is, that I need to find login names from A column in C column and into B column I want to insert number of line, in which is login name as is on sample. I try say it one's more
    function will get login name from the first line (PETER) from column A and try to find it in column C where are long messages. when it find PETER in message, it will put into B column the number of line, where PETER is located. In our case "1" because PETER is in the first line. Then function will go to the second line and get ROMAN. Then it will try to find it in whole column C and when it find ROMAN, it will put the number of line, where is ROMAN located. In our case "2" and so on.. When I will have those numbers of lines of each login name, I will be able to filter messages with autofilter and display only messages with login name that I need.
    huh

    Please Login or Register  to view this content.

  13. #13
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Okay maybe this?

    In B1, try:

    =IF(C1="","",Match(C1,A:A,0))

  14. #14
    Registered User
    Join Date
    09-03-2008
    Location
    Slovakia
    Posts
    20
    Quote Originally Posted by NBVC View Post
    Okay maybe this?

    In B1, try:

    =IF(C1="","",Match(C1,A:A,0))
    OK now it does exactly what I need but it only matches logins in C column, not find. I need to find logins in message like:
    Aging nicht eingeschaltet [ peter ]
    But result in this case is such as I want. Now how to combine your function with SEARCH or FIND function or I don't know which...?

    I hope you understand me

  15. #15
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    tRY

    =MATCH(1,SEARCH("*"&$A$1:$A$10&"*",C1))

    adjust range to suit...

    You must confirm this formula with CTRL+SHIFT+ENTER not just ENTER.. YOu will see { } brackets appear....

    Then copy it down.

  16. #16
    Registered User
    Join Date
    09-03-2008
    Location
    Slovakia
    Posts
    20
    Quote Originally Posted by NBVC View Post
    tRY

    =MATCH(1,SEARCH("*"&$A$1:$A$10&"*",C1))

    adjust range to suit...

    You must confirm this formula with CTRL+SHIFT+ENTER not just ENTER.. YOu will see { } brackets appear....

    Then copy it down.
    good work it's worked as I wanted
    but, in this format
    Please Login or Register  to view this content.
    when it find login, it will put the number of line above. For example in our case when it find ROMAN which is in line 2, it won't put the number 2. It will put number of line abowe, in our case 1.

  17. #17
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Match() finds the position within the defined range...

    so if your Range is (D2:D29) then D2 is position 1 and that is why you are offset by one...

    Try either:

    =MATCH(1;SEARCH("*"&$D$2:$D$29&"*";F2);0)+1

    or

    =MATCH(1;SEARCH("*"&$D$1:$D$29&"*";F2);0)

    Note: I forgot to put the last argument of ,0 on my previous formula... this helps Match() find an exact match.

  18. #18
    Registered User
    Join Date
    09-03-2008
    Location
    Slovakia
    Posts
    20
    Quote Originally Posted by NBVC View Post
    Match() finds the position within the defined range...

    so if your Range is (D2:D29) then D2 is position 1 and that is why you are offset by one...

    Try either:

    =MATCH(1;SEARCH("*"&$D$2:$D$29&"*";F2);0)+1

    or

    =MATCH(1;SEARCH("*"&$D$1:$D$29&"*";F2);0)

    Note: I forgot to put the last argument of ,0 on my previous formula... this helps Match() find an exact match.
    it works perfectly thank you

+ 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. Search dates in column A and return 'year' in column B
    By Prium in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-20-2008, 10:36 PM
  2. How can i search for multiple values to return 1 result using vlookup?
    By buzf355 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-11-2008, 06:28 PM
  3. Return column number
    By oldchippy in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-12-2007, 10:52 AM
  4. return last number in column
    By PaulH_eh in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-23-2007, 03:53 AM
  5. Search array for text, return column #
    By Spreadsheet in forum Excel General
    Replies: 5
    Last Post: 05-09-2007, 12:30 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