+ Reply to Thread
Results 1 to 8 of 8

If statement or Find statement?

  1. #1
    Forum Contributor
    Join Date
    08-26-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2007
    Posts
    149

    If statement or Find statement?

    Hi all,

    I need help again on an If statement?!?!?!

    I am working on contracts (minefield!!) I need it to bring back 100, if the account is out of Warranty but does not begin with Coffee in the account name.

    Account Name Warranty Code
    Coffee Y
    Coffee N
    Sugar N 100
    Tea N 100

    I have attached a spreadsheet for you to play with.

    Cheers

    Donna
    Attached Files Attached Files

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: If statement or Find statement?

    Try
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    Last edited by Ace_XL; 01-07-2013 at 08:37 AM.
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: If statement or Find statement?

    Put this in D3:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    then copy down.

    Hope this helps.

    Pete

  4. #4
    Forum Contributor
    Join Date
    08-26-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: If statement or Find statement?

    Excellant, both approaches work a treat.

    I now need to join this with another formula that I have.

    I have this formula:

    =IF(ISNUMBER(SEARCH("*hotel*",G2)),"1",IF(ISNUMBER(SEARCH("*motel*",G2)),"1",IF(ISNUMBER(SEARCH("*pork*",G2)),"1",IF(ISNUMBER(SEARCH("*beef*",G2)),"1",IF(ISNUMBER(SEARCH("*chicken*",G2)),"1",IF(ISNUMBER(SEARCH("*lamb*",G2)),"1",IF(ISNUMBER(SEARCH("**",F2)),"1",IF(ISNUMBER(SEARCH("**",F2)),"","")))))

    this is saying inthe cell where you are picking up "Coffee", if it says Hotel, Motel, pork, beef, chicken, lamb then bring back 1.

    Is there a way of joining the 2 together, as I need this hierarchy to sort the importance of servicing by company!!

    Cheers for your help

    Donna

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: If statement or Find statement?

    Can you explain the last two terms in your expression, i.e.:

    ...,IF(ISNUMBER(SEARCH("**",F2)),"1",IF(ISNUMBER(SEARCH("**",F2)),"","")))))

    as these seem to be the same condition. How does G2 and F2 relate to the other cells in your sample workbook? Do you really want the text value "1" returned, or should it be the number 1?

    Pete

  6. #6
    Forum Contributor
    Join Date
    08-26-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: If statement or Find statement?

    Hi Pete,

    these are just extra's waiting to be filled in. So if needed please feel free to remove them if it helps your formula to work more smoothly.


    cheers

    Donna

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: If statement or Find statement?

    Well, you could simplify your existing formula by using this array* formula:

    =IF(SUM(IF(ISNUMBER(MATCH({"*hotel*","*motel*","*pork*","*beef*","*chicken*","*lamb*"},G2,0)),1))>1,1,"")

    so to combine this with the other formula you may like to do this:

    =IF(COUNTIF(G2,"Coffee*")>0,"",IF(A3="N",100,IF(SUM(IF(ISNUMBER(MATCH({"*hotel*","*motel*","*pork*","*beef*","*chicken*","*lamb*"},G2,0)),1))>1,1,"")))

    (also an array* formula), although I'm not sure as you haven't really defined your hierarcharcy.

    *An array formula needs to be committed using the key combination of Ctrl-Shift-Enter (CSE) instead of the usual <Enter>.

    Hope this helps.

    Pete

  8. #8
    Forum Contributor
    Join Date
    08-26-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: If statement or Find statement?

    Hi Pete,

    I'll just ahave a go with this. My Hierarchy would be to sort this with 1's at the top, then the blanks with 100's at the bottom. these will be sorted by weeknumber.

    I hope this makes sense.

    cheers

    donna

+ 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