+ Reply to Thread
Results 1 to 6 of 6

Loop formula to search through range to get expected output

  1. #1
    Registered User
    Join Date
    01-28-2014
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    6

    Exclamation Loop formula to search through range to get expected output

    Trying to look for formula for searching through Range and search through Data to achieve expected res

    Data Output Expected Range
    Pune 123 is city Pune 123 Mumbai 999
    Maharashtra 345 is state Maharashtra 345 Pune 123
    India 678 is Country India 678 Nagpur 666
    Maharashtra 666 is state Others Pune 555


    Below is the query i used for manual search however need formula to see through Range and achieve output expected

    =IF(ISNUMBER(SEARCH("Pune 123",A5)),C5,
    IF(ISNUMBER(SEARCH("Maharashtra 345",A6)),C6,
    IF(ISNUMBER(SEARCH("India 678",A7)),C7,"Others")))
    Attached Files Attached Files
    Last edited by raj2989; 02-14-2014 at 09:32 AM.

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,367

    Re: Loop formula to search through range to get expected output

    You have the sample workbook? maybe better if you try to upload it at the forum

  3. #3
    Registered User
    Join Date
    01-28-2014
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Loop formula to search through range to get expected output

    I want to take input from Range column and match it with Data Column and if match found put "results" else "Others"

    i hope you can understand the requirement

  4. #4
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,367

    Re: Loop formula to search through range to get expected output

    Please check the fles, something like this....

    =IF(ISERROR(LOOKUP(2^15;SEARCH(TRIM(LEFT(A2;SEARCH(" ";A2;SEARCH(" ";A2;1)+1)));$C$2:$C$7);$C$2:$C$7));"Others";LOOKUP(2^15;SEARCH(TRIM(LEFT(A2;SEARCH(" ";A2;SEARCH(" ";A2;1)+1)));$C$2:$C$7);$C$2:$C$7))
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-28-2014
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Loop formula to search through range to get expected output

    Azumi

    thanks it worked like charm.....

    One more question how can this query be made ? to search the data in entire text field... its resulting in "Others" when there is some text at start... see the attached example

    Appreciate your help on this
    Attached Files Attached Files

  6. #6
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,367

    Re: Loop formula to search through range to get expected output

    Not clear about the result that you've needed to achieve, maybe describe it with before and after situation....

+ 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] Expected Do before loop (compile error)
    By Rokn in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-08-2013, 07:35 PM
  2. Formula to search column for match and output date in corresponding row
    By bpartin13 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-22-2013, 12:52 AM
  3. Loop to find a criteria within range, then output results to individual lines
    By bologne in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-17-2011, 12:30 PM
  4. Excel 2007 : Excel 2007 Reverse the Expected Output
    By robinx1578 in forum Excel General
    Replies: 6
    Last Post: 09-19-2009, 07:45 AM
  5. [SOLVED] Search range of cells, find a value, output adjoining cell. How?
    By nyys in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-05-2006, 09:55 AM

Tags for this Thread

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