+ Reply to Thread
Results 1 to 7 of 7

Combining search and conditional color formatting for a small database

  1. #1
    Registered User
    Join Date
    04-29-2011
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    3

    Combining search and conditional color formatting for a small database

    Let me first give a short introduction, which might make my problem easier to understand.

    I play a game called Darkspore. In this game you have three squads. Each squad consists of three heroes. Each hero has a few properties:
    Type: Bio, Cyber, Necro, Plasma or Quantum
    Role: Sentinel, Ravager or Tempest

    What I want to make is an overview of my three squads, something like this:
    \1

    Columns A through F hold my current squads. H through M hold the distribution of types between my squads.

    Let me give an example of what I want to be able to do. The image shows how it should look like in the end after filling every name. At first, without any names, everything should be empty and there shouldn't be any colors.

    Now if I for example enter Zrin in squad 1, then the cell with his name should become red, because he's a plasma type. The little square next to his name should become black, because he's also a sentinel. On top of that the cell that stands for a Plasma type in squad 1 should also turn red (in the second table).

    I already have a list with all relevant info, it looks like this:
    \1

    So my first question would be, is this even possible?

    I was thinking of something like this:
    - First you enter a name
    - It gets compared to the list and returns the row it's in
    - Use (D*Result*) and conditional formatting to color the cell in which I just entered the name
    - Use (E*Result*) and conditional formatting to color the little square cell next to the name

    This should take care of the first table.

    Now on to the one that shows the distribution of types. Ideally you would be able to compare background color. For (Bio,Squad1) it would be something like this:
    If(A2.getBackgroundColor() == Colors.Green || C2.getBackgroundColor() == Colors.Green || E2.getBackgroundColor() == Colors.Green) { this.setBackgroundColor(Colors.Green) }

    If this isn't possible, it might be helpful to use the results from the other table and just looking up the type again.

    Even though I'm saying all this, I got no clue as to how to implement this in Excel. I hope someone here might be able to get me started. Or if someone knows a better / easier solution, that would also be nice .

    I added the Excel file as an attachment.
    Attached Files Attached Files
    Last edited by Xylon; 04-30-2011 at 06:26 AM.

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Combining search and conditional color formatting for a small database

    Conditional formatting with vlookup as a formula does the trick for the characters and conditional sums based on vlookup does the trick for the conditional format of the character distribution.

    To check it out, simply click where you'd like to change the character and a dropdown will appear for you to choose a different name.
    Attached Files Attached Files
    Last edited by tlafferty; 04-29-2011 at 10:22 AM.
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Combining search and conditional color formatting for a small database

    See if this gets you underway.

    You should checkout the named range I have added "NamesList", it contains duplicates. I think you might need to base your final sheet on Sheet "Darkspore Data" Column "Complete Name" not "Name".

    Hope this helps

    [EDIT]

    Okay the duplicates are caused by the variant types, so a reduced lookup list should do the job.
    I have updated the attachment.
    Attached Files Attached Files
    Last edited by Marcol; 04-29-2011 at 11:43 AM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  4. #4
    Registered User
    Join Date
    04-29-2011
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Combining search and conditional color formatting for a small database

    Quote Originally Posted by tlafferty View Post
    Conditional formatting with vlookup as a formula does the trick for the characters and conditional sums based on vlookup does the trick for the conditional format of the character distribution.

    To check it out, simply click where you'd like to change the character and a dropdown will appear for you to choose a different name.
    Selecting the characters works like a charm and the colors in the distribution too! Thank you very much .

    Quote Originally Posted by Marcol View Post
    See if this gets you underway.

    You should checkout the named range I have added "NamesList", it contains duplicates. I think you might need to base your final sheet on Sheet "Darkspore Data" Column "Complete Name" not "Name".

    Hope this helps

    [EDIT]

    Okay the duplicates are caused by the variant types, so a reduced lookup list should do the job.
    I have updated the attachment.
    You're right, it does indeed contain duplicate names, but those all have exactly the same type and role.
    Everything you've added works perfect, thank you very much .
    But there is one more thing I'm wondering about. Is it possible to change the background for the cells which hold the names (A2, C2, etc) so they also correspond to the type?
    I was thinking of modifying the formula you used for the type distribution, but I then realized I don't know where to put it, because those cells already contain the names. Is it possible to have both in a single cell?

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Combining search and conditional color formatting for a small database

    That last request will need VBa

    See the attached for the code and where it goes.
    To make references easier I have added some more named ranges, these are now dynamic so you can add names and data as required.

    Hope this helps
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-29-2011
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Combining search and conditional color formatting for a small database

    Quote Originally Posted by Marcol View Post
    That last request will need VBa

    See the attached for the code and where it goes.
    To make references easier I have added some more named ranges, these are now dynamic so you can add names and data as required.

    Hope this helps
    Unbelievable, exactly as I had it in mind! Thank you.

    Do you mind if I share this on the official Darkspore forums? Of course I'll refer to you and this site who've both been very helpful.

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Combining search and conditional color formatting for a small database

    Regarding
    Do you mind if I share this on the official Darkspore forums? Of course I'll refer to you and this site who've both been very helpful.
    Not at all, this is a forum that offers help to all that may benefit.

    If the advice you have been offered satisfies your needs please mark your thread [SOLVED] , doing this helps every one!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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