+ Reply to Thread
Results 1 to 11 of 11

Trying to condense text in IF formula

  1. #1
    Registered User
    Join Date
    11-17-2014
    Location
    Hudson Falls, New York
    MS-Off Ver
    Home and Student 2010
    Posts
    15

    Trying to condense text in IF formula

    I want to compile IF(AND(C12="",C13="",C14="",C15=""),XYZ,"")

    Into IF(ISBLANK(C12:C15),XYZ,"")

    But when I do that, it doesn't work. Is there a more efficient way to say 'If those four cells are blank, use this list, if not, leave blank"?

    Also, I can't use relative references, because this formula determines B12, then B16 has to look at C16:C19. B20 looks at C20:C23, and so on...

    Also, is there a way to program this into VBA? I am learning VBA right now, and have a VERY basic understanding...

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,709

    Re: Trying to condense text in IF formula

    Marginally shorter
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,598

    Re: Trying to condense text in IF formula

    Perhaps =IF(COUNTBLANK(C12:C15)=ROWS(C12:C15),XYZ,"")

    COUNTBLANK counts empty cells AND cells containing the null string

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: Trying to condense text in IF formula

    Please try

    =IF(COUNTA(C12:C15),"",XYZ)

    and for drag down

    =IF(MOD(ROW(),4)+COUNTA(C12:C15),"","XYZ")
    Last edited by Bo_Ry; 02-04-2019 at 10:15 AM. Reason: add 2nd formula

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,598

    Re: Trying to condense text in IF formula

    COUNTA returns 1 for a cell with the null string

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: Trying to condense text in IF formula

    For null string change to

    =IF(MOD(ROW(),4)+COUNTIF(C12:C15,"?*"),"",XYZ)

  7. #7
    Registered User
    Join Date
    11-17-2014
    Location
    Hudson Falls, New York
    MS-Off Ver
    Home and Student 2010
    Posts
    15

    Re: Trying to condense text in IF formula

    Fluff13's resolution works perfectly! Now on the other side of the coin, is it possible to change the other side of the =/<> to a multi-criteria poll?

    Example: IF($B$12<>OR("714-16","715-16"),'LISTA',"")

    I tried using OR() after the = or <>... but it only looks at the first value...

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,709

    Re: Trying to condense text in IF formula

    Not sure if I've understood you correctly, but try
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    11-17-2014
    Location
    Hudson Falls, New York
    MS-Off Ver
    Home and Student 2010
    Posts
    15

    Re: Trying to condense text in IF formula

    Will this make the cell True if B12 is neither 714-16, or 715-16? But if B12 is any other value, including "", then it is false?
    Last edited by AliGW; 02-04-2019 at 02:09 PM.

  10. #10
    Registered User
    Join Date
    11-17-2014
    Location
    Hudson Falls, New York
    MS-Off Ver
    Home and Student 2010
    Posts
    15

    Re: Trying to condense text in IF formula

    =IF(AND($B$16<>{"714-16","715-16"},$B$20<>{"714-16","715-16"},$B$24<>{1158,"714-8","714-16","715-8","715-16"},$J$12&$J$13&$J$14&$J$15=""),Block2_8,"")

    When I enter this in Data Validation, it says "you may not use reference operators (such as unions, intersections, and ranges) or array constants for data validation criteria.

    I had the following as my data validation:
    =IF(AND($B$16<>"714-16",$B$16<>"715-16",$B$20<>"714-16",$B$20<>"715-16",$B$24<>1158,$B$24<>"714-8",$B$24<>"714-16",$B$24<>"715-8",$B$24<>"715-16",$J$12="",$J$13="",$J$14="",$J$15=""),Block2_8,"")

    And it works just fine. Was looking for a way to shorten the code/formula a little bit. Also, anyone know why Data validation doesn't work if you type it somewhere (like Word) then copy/paste to the data validation formula line? It would save me a TON of time writing out these complex formulas if I could copy from word to past into data validation...

  11. #11
    Registered User
    Join Date
    11-17-2014
    Location
    Hudson Falls, New York
    MS-Off Ver
    Home and Student 2010
    Posts
    15

    Re: Trying to condense text in IF formula

    New problem. Boss wants a message to pop up the first time you select "1100R" from one of the many drop downs, but if you put more than one "1100R" he doesn't want a message every time. How do I exit the Sub if the Sub has been run previously?

+ 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. Condense text found in a cell
    By TheHobbit81 in forum Excel General
    Replies: 7
    Last Post: 11-28-2010, 08:54 AM
  2. Condense text to create an index
    By LastShadow in forum Excel - New Users/Basics
    Replies: 8
    Last Post: 06-20-2010, 04:38 AM
  3. [SOLVED] Help to condense a formula
    By N Harkawat in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 12:05 PM
  4. [SOLVED] Help to condense a formula
    By GerryK in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  5. [SOLVED] Help to condense a formula
    By GerryK in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  6. Help to condense a formula
    By GerryK in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  7. [SOLVED] Help to condense a formula
    By GerryK in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10: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