+ Reply to Thread
Results 1 to 8 of 8

Change text of one cell based on the numbers of a range of cells?

  1. #1
    Registered User
    Join Date
    01-18-2013
    Location
    NM
    MS-Off Ver
    Excel 2007
    Posts
    15

    Change text of one cell based on the numbers of a range of cells?

    Howdy!

    I think I have a tough one here.

    I have a row of cells, B8:I8, that have numbers in them controlled by a spin button. The numbers can go from 1 to 20. These numbers are scores.
    The row above this, B6:I6, have names in them that coorespond to the scores.

    What I'm trying to do is have a seperate cell, A1, look in cells B8:I8 and if any of those numbers are 10 or 20 then it will display the cooresponding name above it.

    Ex: If D8 is 10, and D6 is "Bob", then cell A1 will display "Bob". If cell B8 is 20, and B6 is "John", then cell A1 will display "John". If there are no numbers that are 10 or 20 then cell A1 would be blank.

    Is this possible?


    Eric.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Change text of one cell based on the numbers of a range of cells?

    Try this:

    For 10: =INDEX(B6:I6, MATCH(10, B8:I8, 0))

    For 20: =INDEX(B6:I6, MATCH(20, B8:I8, 0))

    For 10, then 20, then Blank: =IFERROR(IFERROR(INDEX(B6:I6, MATCH(10, B8:I8, 0)), INDEX(B6:I6, MATCH(20, B8:I8, 0))), "")
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Change text of one cell based on the numbers of a range of cells?

    Lookup(1e99,match(b8:i8,{10,20},0),b6:i6)

  4. #4
    Registered User
    Join Date
    01-18-2013
    Location
    NM
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Change text of one cell based on the numbers of a range of cells?

    Thanks guys! Both of those work! This site is awesome!

  5. #5
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Change text of one cell based on the numbers of a range of cells?

    You're Welcome!

  6. #6
    Registered User
    Join Date
    01-18-2013
    Location
    NM
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Change text of one cell based on the numbers of a range of cells?

    I have another question about this formula.

    How can it be modified to where if i have a cell with TRUE in it, then the formula won't display a name when a score gets to 10, only 20?

    Basically it's a checkbox. If the checkbox is ticked then the winning score is 20, if it's not ticked then the winning score is 10. My linked cell to the checkbox is W31.

    Or could i just conditionally format AB1 (the cell with the formula in it) to change the text to white if the checkbox's linked cell (W31) is TRUE?
    Last edited by spookymyo; 01-18-2013 at 03:04 PM.

  7. #7
    Registered User
    Join Date
    01-18-2013
    Location
    NM
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Change text of one cell based on the numbers of a range of cells?

    I figured it out with conditional formatting.

    I used this formula to change the text to white if the checkbox is ticked. =UPPER(TRIM($W$31))="TRUE"

  8. #8
    Registered User
    Join Date
    01-18-2013
    Location
    NM
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Change text of one cell based on the numbers of a range of cells?

    Awwwwww crap!

    Conditionally formatting it with: =UPPER(TRIM($W$31))="TRUE" changes the font to white no matter what number it is. So if the checkbox is ticked, W31 is "TRUE" and then cell AB1 has white font no matter what and then when the value is 20 it's still white.

    I'm back to square one. What can i do?

    Edit: I figured it out with the help of another post.

    Eric.
    Last edited by spookymyo; 01-18-2013 at 06:50 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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