+ Reply to Thread
Results 1 to 18 of 18

Using SEARCH and IF function to find two columns from one source

  1. #1
    Registered User
    Join Date
    05-26-2014
    Posts
    9

    Using SEARCH and IF function to find two columns from one source

    Hi Guys

    I hope someone can help, I'm currently doing a project at work where i need to search for data from on sheet on another search.

    The trouble i am having is to search for two columns of data from one search source. I am using a SEARCH formula but i have no idea how implement the IF function i want formula to search department 1 if nothing found then search department 2 from data on search page in C5 but i have no idea if this can be done or how to do it.

    here are the formulas -(-IFERROR(SEARCH(Search!C$5,Data!$I5),"")) this to search department 1 and -(-IFERROR(SEARCH(Search!C$5,Data!$J5),"")) department2

    but at the moment they only return a search if both the data i enter in C5 is in both columns, this not what i want.

    I have made an attachment to show you what i'm working with.


    search data.xlsx

    kind regards

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Using SEARCH and IF function to find two columns from one source

    Is the data in the attachment real? If so, you might want to replace it with insensitive data.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    05-26-2014
    Posts
    9

    Re: Using SEARCH and IF function to find two columns from one source

    no loooool

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Using SEARCH and IF function to find two columns from one source

    Quote Originally Posted by Tricke86 View Post
    no loooool
    Not obvious. Just trying to protect your interests.

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Using SEARCH and IF function to find two columns from one source

    @Tricke86

    Please remove the confidential information from your sheet, and post it again.

    @AliGW

    Very good point
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  6. #6
    Registered User
    Join Date
    05-26-2014
    Posts
    9

    Re: Using SEARCH and IF function to find two columns from one source

    theres no confidential information its all fake

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Using SEARCH and IF function to find two columns from one source

    @Tricke86

    according to your file (which i tried to open in excel 2003) there are links with another workbook.

    In that case i get the faillure "Name".

  8. #8
    Registered User
    Join Date
    05-26-2014
    Posts
    9

    Re: Using SEARCH and IF function to find two columns from one source

    it might be that your using excel 2003, i am working from excel 2010 and 2007

    the link i think your referring too is a hyperlink that takes me to "search" worksheet

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Using SEARCH and IF function to find two columns from one source

    I can confirm that it opens without an error message in Excel 2013.

  10. #10
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Using SEARCH and IF function to find two columns from one source

    hi


    first you creat the index of you data which you want to search and then use match fucnction

  11. #11
    Registered User
    Join Date
    05-26-2014
    Posts
    9

    Re: Using SEARCH and IF function to find two columns from one source

    Hi Sanu2050

    thank your for your solution is it possible you could compile the formula for me please

    Kind regards

  12. #12
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Using SEARCH and IF function to find two columns from one source

    @Tricke86

    Please don't PM me, but ask the question on the forum.

    You halve links to other workbooks in your file?

  13. #13
    Registered User
    Join Date
    05-26-2014
    Posts
    9

    Re: Using SEARCH and IF function to find two columns from one source

    here is the new workbook with no links
    Attached Files Attached Files

  14. #14
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Using SEARCH and IF function to find two columns from one source

    Where do you want the answer.

    Where do you look up the data.

    Please add more informatio.

    What is the desired result.

  15. #15
    Registered User
    Join Date
    05-26-2014
    Posts
    9

    Re: Using SEARCH and IF function to find two columns from one source

    i want the answer to show up on the "search" sheet it brought up by vlookup on that sheet

    the data is taken from "Data" sheet

    the desired result is to search for two columns of data from one search source. AN example in C5 on the search tab i type "Admin" the results should bring up results that were found in department 1 and 2 on the data tab.

    At the moment it only returns items that are found in both departments example employee Ross has Admin in department 1 and Admin in department 2. However, if employee Ryan has Admin in department 1 and R&D in department 2 it wont show a result.

    Therefore i need a formula that can return results from either column of data My Logic is : If data not found in department 1 then search department 2.

  16. #16
    Registered User
    Join Date
    05-26-2014
    Posts
    9

    Re: Using SEARCH and IF function to find two columns from one source

    Quote Originally Posted by oeldere View Post
    Where do you want the answer.

    Where do you look up the data.

    Please add more informatio.

    What is the desired result.
    i want the answer to show up on the "search" sheet it brought up by vlookup on that sheet

    the data is taken from "Data" sheet

    the desired result is to search for two columns of data from one search source. AN example in C5 on the search tab i type "Admin" the results should bring up results that were found in department 1 and 2 on the data tab.

    At the moment it only returns items that are found in both departments example employee Ross has Admin in department 1 and Admin in department 2. However, if employee Ryan has Admin in department 1 and R&D in department 2 it wont show a result.

    Therefore i need a formula that can return results from either column of data My Logic is : If data not found in department 1 then search department 2.

  17. #17
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Using SEARCH and IF function to find two columns from one source

    Hi

    You have to use same formula in both coloumn formuls is

    =index(select departmentcolumn ,match(select the name of employee, than select the column in which all name , 0,)

  18. #18
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Using SEARCH and IF function to find two columns from one source

    Try this Array Formula in D10. Since this is an array formula so you need to confirm it with Ctrl+Shift+Enter instead of just Enter. (i.e. after pasting the formula in D10, press F2 (Function Key), hold down the Ctrl+Shift together and then press Enter.)

    While C5 = "Admin", in D10

    Please Login or Register  to view this content.
    and then copy across and down.

    Is this what you are trying to achieve?
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

+ 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] .Find Help - Search only in specific columns (or ignore other columns)?
    By NewYears1978 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2014, 11:32 AM
  2. Replies: 5
    Last Post: 05-18-2011, 07:20 PM
  3. How do I find the source of a worksheet VBA function?
    By rutherford in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-30-2010, 07:10 AM
  4. Can I use Find to search columns by default??
    By colwyn in forum Excel General
    Replies: 2
    Last Post: 02-11-2009, 03:24 AM
  5. Search multiple columns and find corresponding value
    By smcg23 in forum Excel General
    Replies: 3
    Last Post: 11-04-2008, 07:44 AM

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