+ Reply to Thread
Results 1 to 11 of 11

Forumla help for SEARCH and IF

Hybrid View

SharpL Forumla help for SEARCH and IF 10-10-2014, 05:21 AM
Olly Re: Forumla help for SEARCH... 10-10-2014, 05:28 AM
SharpL Re: Forumla help for SEARCH... 10-10-2014, 05:29 AM
SharpL Re: Forumla help for SEARCH... 10-10-2014, 05:44 AM
SharpL Re: Forumla help for SEARCH... 10-10-2014, 06:33 AM
Olly Re: Forumla help for SEARCH... 10-10-2014, 05:52 AM
SharpL Re: Forumla help for SEARCH... 10-10-2014, 06:31 AM
Olly Re: Forumla help for SEARCH... 10-10-2014, 06:36 AM
SharpL Re: Forumla help for SEARCH... 10-10-2014, 07:23 AM
Olly Re: Forumla help for SEARCH... 10-10-2014, 07:30 AM
SharpL Re: Forumla help for SEARCH... 10-10-2014, 08:28 AM
  1. #1
    Forum Contributor
    Join Date
    09-18-2014
    Location
    England
    MS-Off Ver
    2003/2010/365
    Posts
    119

    Lightbulb Forumla help for SEARCH and IF

    Hi,

    I want a forumla that states IF cell F5 contains "paint" then return "@PAINT"

    F5 may contain other values as well besides 'paint' so =if(f5="paint","@PAINT","") won't work.

    Many thanks

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Forumla help for SEARCH and IF

    Try:
    Formula: copy to clipboard
    =IF(ISERROR(SEARCH("paint",F5)),"","@PAINT")
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Contributor
    Join Date
    09-18-2014
    Location
    England
    MS-Off Ver
    2003/2010/365
    Posts
    119

    Re: Forumla help for SEARCH and IF

    Thank you

  4. #4
    Forum Contributor
    Join Date
    09-18-2014
    Location
    England
    MS-Off Ver
    2003/2010/365
    Posts
    119

    Re: Forumla help for SEARCH and IF

    I have created the below:

    Formula: copy to clipboard
    =IF(ISERROR(SEARCH("paint",F64)),IF(ISERROR(SUBSTITUTE(F16," ","")*SEARCH("@JT",G64)),IF(ISERROR(SEARCH("transport",F64)),"","@TRANSPORT"),"@SUBCON"),"@PAINT")


    However the @SUBCON part isn't working when G64 contains "@JT", so long as G64 has no spaces (spaces " " substituted for "")

    Any advice?
    Last edited by SharpL; 10-10-2014 at 06:31 AM.

  5. #5
    Forum Contributor
    Join Date
    09-18-2014
    Location
    England
    MS-Off Ver
    2003/2010/365
    Posts
    119

    Re: Forumla help for SEARCH and IF

    Should be:

    Formula: copy to clipboard
    =IF(ISERROR(SEARCH("paint",F64)),IF(ISERROR(SUBSTITUTE(G64," ","")*SEARCH("@JT",G64)),IF(ISERROR(SEARCH("transport",F64)),"","@TRANSPORT"),"@SUBCON"),"@PAINT")


    But still doesn't work?
    Last edited by SharpL; 10-10-2014 at 07:23 AM.

  6. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Forumla help for SEARCH and IF

    What are you trying to achieve with this part:
    Formula: copy to clipboard
    IF(ISERROR(SUBSTITUTE(F16," ","")*SEARCH("@JT",G67))


    Do you want to return "@SUBCON" if G67 contains "@JT" and F16 is a number? As that is how it is currently evaluating...

  7. #7
    Forum Contributor
    Join Date
    09-18-2014
    Location
    England
    MS-Off Ver
    2003/2010/365
    Posts
    119

    Re: Forumla help for SEARCH and IF

    One sec, just noticed that. I'll ammend now.

  8. #8
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Forumla help for SEARCH and IF

    And still doesn't explain what you are trying to achieve....

    Explain in simple terms which criteria you want to return "@SUBCON"

  9. #9
    Forum Contributor
    Join Date
    09-18-2014
    Location
    England
    MS-Off Ver
    2003/2010/365
    Posts
    119

    Re: Forumla help for SEARCH and IF

    Apologises.

    Forumla =
    If F64 contains 'paint', return '@PAINT'
    If F64 contains 'transport', return '@TRANSPORT'
    If G64 contains '@JT', return '@SUBCON' - I need to remove spaces here via Substitute(G64," ","") to ensure '@JT' is captured, as this may return as any variation of "@ JT".

  10. #10
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Forumla help for SEARCH and IF

    Then try:
    Formula: copy to clipboard
    =IF(ISERROR(SEARCH("paint",F64)),IF(ISERROR(SEARCH("transport",F64)),IF(ISERROR(SEARCH("@JT",SUBSTITUTE(G64," ",""))),"","@SUBCON"),"@TRANSPORT"),"@PAINT")

  11. #11
    Forum Contributor
    Join Date
    09-18-2014
    Location
    England
    MS-Off Ver
    2003/2010/365
    Posts
    119

    Re: Forumla help for SEARCH and IF

    Perfect, 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. VBA Code - Search text & search number & search qty and result - Urgent Please
    By naresh73 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2014, 10:51 AM
  2. Conditional Forumla with Forumla assigned- Help needed
    By MarkoPolo in forum Excel General
    Replies: 3
    Last Post: 03-06-2014, 06:46 PM
  3. [SOLVED] Excel forumla to search in different excel file for matching criteria
    By cmeunier1973 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-24-2010, 11:29 AM
  4. Multiple IF and SEARCH Forumla
    By AustExcel in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-19-2009, 11:45 PM
  5. Replacing a cell's forumla with the forumla's results?
    By Mooncalf in forum Excel General
    Replies: 2
    Last Post: 01-04-2005, 12:35 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