+ Reply to Thread
Results 1 to 4 of 4

Writing an =if statement with contains

  1. #1
    Registered User
    Join Date
    08-13-2012
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2007
    Posts
    15

    Talking Writing an =if statement with contains

    I am trying to write an If statement where if a cell says Heritage I want Heritage to appear in another cell.
    I am in Cell V and the cell is empty.
    I want a formula in V that asks If cell I contains "Heritage" for cell V to display "Heritage" and if Cell I contains "Telus" for cell V to display "Telus"

    I am pretty sure I have to use Contains Heritage and Telus as there are several connotations of those companies, but all have those terms in them.

    I have tried =if(I6_contains "Heritage", "Heritage" "") and I got an error message.
    Last edited by 1Monkey; 10-12-2012 at 12:20 PM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Writing an =if statement with contains

    Try this nested IF statement.

    =IF(I6 = "Heritage","Heritage",IF(I6 = "Telus","Telus",""))

    I'm assuming that you are looking for an exact match and not a substring.
    Martin

  3. #3
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    wales
    MS-Off Ver
    Excel 2007
    Posts
    964

    Re: Writing an =if statement with contains

    just a thought

    =if(I2="Heritage","Heritage",if(I2="Telus","Telus",""))

    but why couldnt you just use

    V2=I2 (unless we are missing somthing here (as in the cell contains more than Heritage or Telus

    in which case

    do this

    =IF(I2="","",IF(ISNUMBER(SEARCH(I2,"Heritage")),"Heritage",IF(ISNUMBER(SEARCH(I2,"Telus")),"Telus","")))
    Last edited by twiggywales; 10-12-2012 at 12:21 PM.
    The Importance of INDEX - A GUIDE TO INDEX'S OTHER USES
    <--- If a post helps hit the star

  4. #4
    Registered User
    Join Date
    08-13-2012
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Writing an =if statement with contains

    Thank you! You saved me a lot of time and I will donate to charity!!

+ 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