+ Reply to Thread
Results 1 to 3 of 3

Formatting text without millions of nested IF statements

  1. #1
    Registered User
    Join Date
    09-01-2011
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    78

    Formatting text without millions of nested IF statements

    I've got a cell, A1.

    A1 is "(A/B/C/D)" exactly as I've shown, including brackets and "/"

    Now I want this cell to show A if named range AY is TRUE (using a checkbox). Same for B: show it only if named range BY is TRUE. Same for C: show it only if named range CY is TRUE, and so on...

    But note that the formatting quickly looks off and it's hard to get a "/" showing up appropriately without using multiple nested if statements which make enormous ugly formulas.

    If only named range AY is TRUE I want A1 to be "(A)". If only BY is true, I want A1 to be (B). If BY and DY are true I want A1 to be "(B/D)".

    See what I mean?

    I can use this formula A1=if(AY, "(A)", if(BY, "(A/B)","(A)",.... and you see how this'll just get enormous accounting for all combinations.

    Any options?

  2. #2
    Registered User
    Join Date
    06-15-2015
    Location
    Lausanne, Switzerland
    MS-Off Ver
    2016
    Posts
    9

    Re: Formatting text without millions of nested IF statements

    Hi there,
    would something like this work?

    =SUBSTITUTE("(" & if(AY,"A/","") & if(BY,"B/","") & if(CY,"C/","") & if(DY,"D/","") & ")","/)",")")

    Hope this helps

  3. #3
    Registered User
    Join Date
    09-01-2011
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    78

    Re: Formatting text without millions of nested IF statements

    Yes, that's exactly what I was looking for!

+ 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. Nested IF Statements Using Just Text - No Numbers
    By salhakim in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-01-2015, 05:43 PM
  2. nested if statements to output text
    By tedk1967 in forum Excel General
    Replies: 4
    Last Post: 08-07-2011, 02:10 PM
  3. Nested IF statements with Text as IF and THEN (Excel 2007)
    By mrsbigglesworth in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-13-2010, 09:02 AM
  4. Nested IF statements with Text as IF and THEN (Excel 2007)
    By mrsbigglesworth in forum Excel General
    Replies: 2
    Last Post: 12-13-2010, 01:48 AM
  5. Excel 2007 : Nested IF Statements and string text
    By katharineb in forum Excel General
    Replies: 5
    Last Post: 07-22-2010, 05:20 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