+ Reply to Thread
Results 1 to 3 of 3

Improving/Consolidating a Long IF Formula

  1. #1
    Registered User
    Join Date
    12-07-2022
    Location
    Colorado
    MS-Off Ver
    2023
    Posts
    1

    Improving/Consolidating a Long IF Formula

    Hello,

    I am using this in one of my fields:

    =IF(M828=1,M828&"st Grade",(IF(M828=2,M828&"nd Grade",(IF(M828=3,M828&"rd Grade",(IF(M828="K","Kindergarten",(IF(M828="PreK","PreK",(IF(M828="PreS","PreSchool",(IF(M828="Tod","Toddler",M828&"th Grade")))))))))))))

    This formula changes a field number like "1" to "1st Grade" and so forth.

    I am certain there is a simpler way to do this, but not sure how. Any ideas?

    Thanks in advance!
    Last edited by AliGW; 12-07-2022 at 12:34 PM. Reason: Thread title improved - please make your thread titles explicit & not generic in future.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Improving/Consolidating a Long IF Formula

    Welcome to the forum.

    Please make your thread ttiles better in future - I have changed yours for you today.

    You could use a LOOKUP or VLOOKUP formula.

    There are instructions at the top of the page explaining how to attach your sample workbook. Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    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,152

    Re: Improving/Consolidating a Long IF Formula

    AS per Ali's solution:

    =IFERROR(VLOOKUP($E1,$C$1:$D$7,2,0),$E1 & "th Grade")
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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] Long formula breaks when adding nested IF
    By mgumapas in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-28-2020, 07:52 AM
  2. If w/ Nested OR and AND driving me crazy
    By bcochra in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 12-04-2016, 03:05 PM
  3. [SOLVED] Nested Formulas: Getting Crazy
    By jcri227 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-18-2015, 01:08 PM
  4. 20+ Nested If Statements - Formula too long
    By Gen8888 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-10-2011, 12:25 PM
  5. Long nested formula in VBA
    By cheerockracy in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-23-2009, 05:06 PM
  6. Nested IF Driving me crazy
    By orpheuswaking in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-24-2007, 10:38 PM
  7. Formula too long - Nested IF statement with VLOOKUP
    By FurniKing in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-26-2006, 04:34 AM

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