+ Reply to Thread
Results 1 to 8 of 8

Assign a value(s) based on the content of a cel?

  1. #1
    Registered User
    Join Date
    06-30-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    19

    Question Assign a value(s) based on the content of a cel?

    Hello- I need a couple formulas that would assign a certain value(s) based on a 3-digit course/section number.

    Formula #1:
    So for course 1 there are 36 possible levels. If the 3-digit section number is "101" or "201" then the level is 1, "102" or "202" then the level is 2, "103 or 203" then the level is 3 and so forth until we reach "136" or "236" for level 36.

    Formula #2:
    For course 2, if the 3-digit section number middle digit is "1" then the category is "Beginner", "2" the category "Amateur", "3" the category is "Intermediate", and "4" the category is "Expert". Then the last digit provides the level within that category (there are 9). So for example:

    Column A Column B Column C

    Section Category Level
    111 Beginner 1
    123 Amateur 3
    149 Expert 9

    I have tried nested IFs with ISNUMBER, SEARCH, and OR functions but couldn't make it work. Appreciate any help. Thanks

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Assign a value(s) based on the content of a cel?

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Assign a value(s) based on the content of a cel?

    With your example the folowing formulas will do the job:
    Formula #1
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Formula #2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Cheers!
    Tsjallie




    --------
    If your problem is solved, pls mark the thread SOLVED (see Thread Tools in the menu above). Thank you!

    If you think design is an expensive waste of time, try doing without ...

  4. #4
    Registered User
    Join Date
    06-30-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Assign a value(s) based on the content of a cel?

    Looks right on but keep in mind there are 36 levels not 9. So section "110" or "210" is level 10 not level 0

  5. #5
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Assign a value(s) based on the content of a cel?

    Then your section id's are ambigious. "211" might indicate level 1 or level 11. There is no way to know when to use just the last digit or the last two digits.
    You need to always use two digits for idicating the level. So level 9 would be indicated by "1109" instead of "119".

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Assign a value(s) based on the content of a cel?

    Is formula #1 not ....

    =RIGHT(A2,2)

    101=(0)1, 110=10, 136=36

  7. #7
    Registered User
    Join Date
    06-30-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Assign a value(s) based on the content of a cel?

    Yes, formula #1 works with 2 digits. Thank you so much. Formula #2 works but on the categories with 10 levels I had to make some adjustments, eg. =RIGHT(A2,1)+1 for section 140, level 1 expert (section 149 would be level 10). Thank you all!

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Assign a value(s) based on the content of a cel?

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Assign a value to a cell based on a portion of the content of another cell
    By smatchymo in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-08-2015, 02:56 PM
  2. Automatically copy cells content based on the content of another cell.
    By chrisbarlow1984 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-01-2014, 11:13 AM
  3. Replies: 3
    Last Post: 04-23-2013, 03:46 PM
  4. [SOLVED] assign cell content to variable
    By echomom in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-26-2011, 01:47 PM
  5. Replies: 2
    Last Post: 12-19-2006, 10:50 PM
  6. Assign Cell Content As File Name
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-18-2005, 02:05 PM
  7. [SOLVED] assign cell content as file name
    By [email protected] in forum Excel General
    Replies: 1
    Last Post: 10-18-2005, 01:05 PM

Tags for this Thread

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