+ Reply to Thread
Results 1 to 4 of 4

Formula to set text values in a cell based on a number entered in another cell

  1. #1
    Registered User
    Join Date
    11-19-2015
    Location
    Perth
    MS-Off Ver
    15.14
    Posts
    2

    Formula to set text values in a cell based on a number entered in another cell

    I need a formula to to set the following 4 text values in a cell (B1) based on a range of numbers entered in another cell (A1):

    Text value "Small" if number entered is less than 8.
    Text value "Medium" if number entered is between 9 and 15 (inclusive).
    Text value "Large" if number entered is between 16 and 20 (inclusive).
    Text value "Error" if number entered is greater then 20.

    Can anyone help please? It's driving me nuts!

    Thanks,
    Osmer

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

    Re: Formula to set text values in a cell based on a number entered in another cell

    Try this in B1:

    =IF(A1="","",IF(A1<=8,"Small",IF(A1<=15,"Medium",IF(A1<=20,"Large","Error"))))

    Hope this helps.

    Pete

  3. #3
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Formula to set text values in a cell based on a number entered in another cell

    Use VLOOKUP with a 1 at the end.
    Attached Files Attached Files
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  4. #4
    Registered User
    Join Date
    11-19-2015
    Location
    Perth
    MS-Off Ver
    15.14
    Posts
    2

    Re: Formula to set text values in a cell based on a number entered in another cell

    I used Pete's formula, it worked perfectly.
    Thanks guys.

+ 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 to format cell into date based on number entered into cell
    By b624333 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-02-2014, 08:16 PM
  2. [SOLVED] VBA to change text in a cell based on the value entered in another cell
    By karen2712 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-29-2014, 06:00 AM
  3. Replies: 4
    Last Post: 06-24-2013, 02:16 PM
  4. VBA code to unhide X number of rows based on a number entered into a cell above
    By gazza365 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-09-2010, 08:48 PM
  5. Replies: 8
    Last Post: 06-20-2008, 08:01 AM
  6. VBA to show certain text when a number is entered into a cell
    By jiminic in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-01-2008, 12:34 AM
  7. Entered text value equals a number I specify in another cell
    By JE McGimpsey in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 06:05 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