+ Reply to Thread
Results 1 to 3 of 3

If a cell has certain text then return value?

  1. #1
    Registered User
    Join Date
    08-06-2009
    Location
    South Africa
    MS-Off Ver
    Excel 2003
    Posts
    2

    Exclamation If a cell has certain text then return value?

    How do i write an If function where if a cell has a certain text in it, it would return a value to onather cell.

    For instance:
    If cell B1 has "red" in it the cell B4 must be "6"
    If cell B1 has 'blue" in it, then cell B4 must be "7"
    and so on with certain text returning a certain value?

    Please can you help me?
    Last edited by Flash101; 08-06-2009 at 06:29 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: If a cell has certain text then return value?

    Depending on how many strings you have...

    =IF(B1="red",6,IF(B1="blue",7,0))

    If you have lots then list the colours in one column, say C1 onwards (red,blue etc..) and the associated values in an adjacent column, say D1 onwards (6,7 etc...) then:

    =VLOOKUP(B1,C:D,2,0)

    Going forward please ensure you post in the most relevant forum - I have moved this from Outlook Forum to Excel Worksheet Functions.

  3. #3
    Registered User
    Join Date
    08-06-2009
    Location
    South Africa
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: If a cell has certain text then return value?

    Thanks, you have solved my problem.
    Many thanks.

+ 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