+ Reply to Thread
Results 1 to 8 of 8

Creating a Text value from a range of cells dependant on the answers.

  1. #1
    Registered User
    Join Date
    09-20-2012
    Location
    Peoria, Arizona
    MS-Off Ver
    Excel 2013
    Posts
    39

    Creating a Text value from a range of cells dependant on the answers.

    I tried searching the forum and I think a big part of my problem is trying to figure out how to express what I am trying to do. I am certain the answer is easy and has already out there but I am going to throw it out there anyway.

    I have a line of cells with Drop down Lists. The Cells are in the range of J2:P2. The Drop down has 3 options, Yes, No, and NA. What I am trying to do is make Cell R2 Read either "Pass" or "Fail" if any cell in the range equals "No". I have tried assigning numberical values in hidden cells (I can only assign numbers for two of the values), I have tried Assign the values to new cells and use If then formating: =IF(J2:P2=A24,"Fail", IF(J2:P2=A23,"Pass", IF(J2:P2=A25,"PassIf("J2+"","")))) and I just can't figure out how to get the cell to work. Any ideas on how to do this?

    This is what I get with the formulas so far:
    J2 K2 L2 M2 N2 O2 P2 R2
    Yes Yes Yes Yes Yes Yes Yes #VALUE!


    I want it to do this:
    J2 K2 L2 M2 N2 O2 P2 R2
    Yes Yes Yes Yes Yes Yes Yes Pass
    or:
    J2 K2 L2 M2 N2 O2 P2 R2
    Yes No Yes Yes Yes Yes Yes Fail

  2. #2
    Forum Contributor gsnidow's Avatar
    Join Date
    07-22-2010
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2007
    Posts
    150

    Re: Creating a Text value from a range of cells dependant on the answers.

    Try this in cell R2...
    Please Login or Register  to view this content.
    There is probably a way to scan the entire range, rather than hard coding all of them, but this will work.

    Greg
    Just a guy trying to make work stuff easier.

  3. #3
    Registered User
    Join Date
    09-20-2012
    Location
    Peoria, Arizona
    MS-Off Ver
    Excel 2013
    Posts
    39

    Re: Creating a Text value from a range of cells dependant on the answers.

    I figured out another solution as well. I assigned each answer in each cell in the range a numerical value by formating a second hidden cell as:

    =IF(J2="No", 0, IF(J2="Yes", 1, IF(J2="NA", 1, IF(J2="", 0)))) .

    I then summed them in another cell and then formatted the final cell as,

    =IF(BJ2<7,"Fail",IF(BJ2=7,"Pass"))

    this seems to work.

  4. #4
    Registered User
    Join Date
    09-20-2012
    Location
    Peoria, Arizona
    MS-Off Ver
    Excel 2013
    Posts
    39

    Re: Creating a Text value from a range of cells dependant on the answers.

    I actually switched over to the code suggested by gsnidow and it works great. Way simpler then my number code. However, I was wondering if there was also a way to make the final cell read "" (blank) if any of the cells in the range were also left blank? Ideas?

  5. #5
    Forum Contributor gsnidow's Avatar
    Join Date
    07-22-2010
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2007
    Posts
    150

    Re: Creating a Text value from a range of cells dependant on the answers.

    Try this. It's getting kind of big, but I still think there is a better way. I'll do some googling and post back if I come up with something better.
    Please Login or Register  to view this content.
    Greg

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Creating a Text value from a range of cells dependant on the answers.

    Maybe this...

    =IF(COUNTIF(J2:P2,""),"",IF(COUNTIF(J2:P2,"No"),"Fail","Pass"))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Registered User
    Join Date
    09-20-2012
    Location
    Peoria, Arizona
    MS-Off Ver
    Excel 2013
    Posts
    39

    Re: Creating a Text value from a range of cells dependant on the answers.

    Wow! It works! Thanks so much. I need to learn more about the Countif function.

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Creating a Text value from a range of cells dependant on the answers.

    You're welcome. Thanks for the feedback!

+ 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. Counting text in cells dependant on a date range
    By Netski in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-28-2013, 10:08 AM
  2. Replies: 5
    Last Post: 04-16-2012, 06:21 AM
  3. Highlighting a range of cells dependant on data in any of those cells
    By Grimace in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-20-2009, 02:34 AM
  4. Lock range of cells dependant on date range
    By stir-crazy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-18-2008, 09:40 PM
  5. Replies: 0
    Last Post: 12-09-2005, 04:30 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