+ Reply to Thread
Results 1 to 7 of 7

Display text depending on one or more cell with value

  1. #1
    Registered User
    Join Date
    10-09-2014
    Location
    New York, United States
    MS-Off Ver
    2007
    Posts
    5

    Display text depending on one or more cell with value

    Hey Guys,

    So I'm trying to make a formula that will display a text depending on if there is only one cell in a column or if there are more than one values entered. I've tried stringing together if statements with an Index Match formula but it keeps displaying the same text regardless of if there is one or more than one value that is greater than 0 in the column. Could anyone help me out?

  2. #2
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Display text depending on one or more cell with value

    The formula below should work. Assuming your data is in A1:A50, which can be changed as necessary.

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

  3. #3
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,007

    Re: Display text depending on one or more cell with value

    For column A:

    =IF(COUNTIF(A:A,">0")=1,"Text when One value is found",IF(COUNTIF(A:A,">0")>1,"Text for More than one","Text for None"))
    Bernie Deitrick
    Excel MVP 2000-2010

  4. #4
    Registered User
    Join Date
    10-09-2014
    Location
    New York, United States
    MS-Off Ver
    2007
    Posts
    5

    Re: Display text depending on one or more cell with value

    Thanks Bernie!

    I got it to work using two criteria but when I expanded it to add other criteria I got a parse error, could someone help me out?

    =IF(COUNTIF($D$2:$D$41,">0")=1,$B$2:$B$41,IF(COUNTIF($D$2:$D$16,">0")>1,"Apparel Collection",IF(COUNTIF($D$17:$D$41,">0")>1"Accessories Collection",IF(COUNTIF($D$2:$D$41,">0")>1"Collection",""))))

  5. #5
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,007

    Re: Display text depending on one or more cell with value

    Well, you are missing some commas:

    =IF(COUNTIF($D$2:$D$41,">0")=1,$B$2:$B$41,IF(COUNTIF($D$2:$D$16,">0")>1,"Apparel Collection",IF(COUNTIF($D$17:$D$41,">0")>1,"Accessories Collection",IF(COUNTIF($D$2:$D$41,">0")>1,"Collection",""))))

    But this part won't work:

    $B$2:$B$41:

    You need to extract the specific value from that range - Perhaps this, array entered (enter using Ctrl-Shift-Enter)

    =IF(COUNTIF($D$2:$D$41,">0")=1,INDEX($B$2:$B$41,MATCH(TRUE,$D$2:$D$41>0,FALSE)),IF(COUNTIF($D$2:$D$16,">0")>1,"Apparel Collection",IF(COUNTIF($D$17:$D$41,">0")>1,"Accessories Collection",IF(COUNTIF($D$2:$D$41,">0")>1,"Collection",""))))

    Still, you would be better off describing what you have and what you want rather than posting a failed formula.....

  6. #6
    Registered User
    Join Date
    10-09-2014
    Location
    New York, United States
    MS-Off Ver
    2007
    Posts
    5

    Re: Display text depending on one or more cell with value

    That worked perfectly! Thanks again for all of your help with this. I was racking my brain for too long.

  7. #7
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,007

    Re: Display text depending on one or more cell with value

    Not perfectly - I think you should check it this way (again, array-entered), which is better logic, at least to me:

    =IF(COUNTIF($D$2:$D$41,">0")=1,INDEX($B$2:$B$41,MATCH(TRUE,$D$2:$D$41>0,FALSE)),IF(AND(COUNTIF($D$2:$D$16,">0")>1, COUNTIF($D$17:$D$41,">0")>1),"Collection",IF(COUNTIF($D$2:$D$16,">0")>1,"Apparel Collection",IF(COUNTIF($D$17:$D$41,">0")>1,"Accessories Collection",""))))

+ 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. Display a value or text in a cell depending on value in another cell
    By zoboran in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-10-2013, 10:49 AM
  2. Display last text value depending on another cell
    By willia97 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-14-2012, 01:19 AM
  3. Display R, A or G depending on text in 2 other cells
    By raehippychick in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-15-2009, 08:10 AM
  4. Display text depending on values of 3 different cells?
    By henrat in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-22-2005, 02:09 PM
  5. Display text depending on cell value
    By yalex in forum Excel General
    Replies: 2
    Last Post: 02-04-2005, 05:37 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