+ Reply to Thread
Results 1 to 4 of 4

Can I use an IF function to display a certain number if a cell begins in a certain string?

  1. #1
    Registered User
    Join Date
    10-23-2014
    Location
    NJ
    MS-Off Ver
    2007
    Posts
    8

    Can I use an IF function to display a certain number if a cell begins in a certain string?

    Here is what I want to do:

    If cell A1 begins in text "GR" I want cell B2 to display "5"
    But I want to work with different numbers...so if cell A1 begins in "RSS" I want cell B2 to display "10"

    Is this possible?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,720

    Re: Can I use an IF function to display a certain number if a cell begins in a certain str

    There are two ways to do this. If you have several different strings that you're looking for, it is better to set up a table and then use a VLOOKUP formula in B2. I can demonstrate if you provide your file.

    The other way is to build it into a formula:

    =IF(LEFT(A1,2)="GR",5,IF(LEFT(A1,3)="RSS",10,"Not found"))
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    10-23-2014
    Location
    NJ
    MS-Off Ver
    2007
    Posts
    8

    Re: Can I use an IF function to display a certain number if a cell begins in a certain str

    Quote Originally Posted by 6StringJazzer View Post
    There are two ways to do this. If you have several different strings that you're looking for, it is better to set up a table and then use a VLOOKUP formula in B2. I can demonstrate if you provide your file.

    The other way is to build it into a formula:

    =IF(LEFT(A1,2)="GR",5,IF(LEFT(A1,3)="RSS",10,"Not found"))
    Thank you, that worked perfectly.
    Another question, if you are able to answer.

    I have 2 worksheets in this file. The second one has a listing of product codes and descriptions on it. In the first one I want to type in the product code and have the description automatically generate in the next cell to the right. Is there a way to have it pull that description automatically from the second worksheet if the product code matches?

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,720

    Re: Can I use an IF function to display a certain number if a cell begins in a certain str

    Yes. Either attach your file or provide the following information:

    • Name of the second sheet (with product codes and descriptions)
    • Column containing product codes
    • Column containing descriptions

+ 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] Display chosen number if cell text begins with specific letter
    By BPSJACK in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-03-2014, 07:12 AM
  2. sumif cell begins with a number but also contains letters
    By agni452 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-28-2013, 09:25 PM
  3. [SOLVED] IF number/text in a cell begins with specific letter, then return desired word
    By BPSJACK in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-28-2013, 06:02 AM
  4. [SOLVED] Insert text to cell based on whether the value begins with a letter or number.
    By BPSJACK in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-23-2012, 09:57 AM
  5. Replies: 5
    Last Post: 11-22-2010, 06:31 PM

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