+ Reply to Thread
Results 1 to 10 of 10

Counting Cell Colours and Content

  1. #1
    Registered User
    Join Date
    05-28-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    9

    Counting Cell Colours and Content

    First time posting on this forum because it’s not too often I delve this deeply into Excel formulas, but I’m currently looking to adapt a spreadsheet that is currently widely used across my workplace.
    I will try my hardest to give much information as possible regarding my query, so here is it:
    I currently have a spreadsheet for a school that is essentially a DayPlan (attendance sheet) for what classes students will be in every day. Students change subject lines and classes so often, that these DayPlans are generated on the daily. This is what an empty DayPlan sheet looks like, as you can imagine, each day there are *unique* student names added to the sheet.
    Sheet.PNG
    This spreadsheet (which belongs to workbook) is then heavily locked down, simply allowing teachers to come in and use the key on the right to colourcode (format painter) the kids in their class as to whether they were present/absent, etc (with a few other options you can see).
    Given our student subject lines change all the time, along with a number of other factors, we never found a suitable solution for recording attendance until this workbook. The Principal loves it, but would like to be able to generate weekly sheets from said data.
    What we’re trying to do is to create a sheet in the workbook that would calculate a student’s attendance per week (ie how many lessons were they present and home many were they away).
    To do this though I need a way to count colours and cell content. I have both of these separately but not together.
    This tool allowed me to count colours of cells and works perfectly, however I need to sweep the whole sheet for colours *and* names. https://www.extendoffice.com/documen...-by-color.html

    To put in in basic code I need something that will go:
    COUNT number of cells IF cell is green AND cell contains the name ‘Bob’
    If I could figure out the way to do this for present students I’m sure I could modify the function for away students and cross sheet calculations.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Counting Cell Colours and Content

    Hi Tim and welcome to the forum,

    Color would be much easier if you could put a letter in each cell some how.

    Are you suggesting that all the student's names populate the cells in your example above? Then the teachers come in and "format paint" over the student's names to show their status? Is that how this works?

    Instead of trying to guess how you use the above, I've seen some sites that might be of interest. Look at:
    https://www.ablebits.com/office-addi...y-color-excel/

    and see if that is what you need.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    05-28-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    9

    Re: Counting Cell Colours and Content

    Hi Marvin and thanks for your response.
    Unfortunately nothing in that link is quite what I need.
    I know how to count and sum based on colour, but I can't seem to filer those counts based on the text *in* the cell.
    You are right though in saying names would populate each lesson on that sheet.
    I then want to be able to search all cells for a name and colour combination and count how many there are.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Counting Cell Colours and Content

    So let me see if I can understand this...

    You have John Smith in about 5 cells and you want to show him having 2 Red and 2 green and 1 Away (for example)?

    Do you want to show each student (alphabetically) and then show how many of each color they have?

    I think a simple example, where you show some names and what you expect your result to be, would help us get you a better answer.

    I'm really thinking about putting a number at the end of each of your names. 1=Present, 2=Removed, ...
    Is this an option you might accept?

    Let's see if another "guru" can understand your question who is a lot better with colors and pivots.

  5. #5
    Registered User
    Join Date
    05-28-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    9

    Re: Counting Cell Colours and Content

    What you've said there:
    ---
    You have John Smith in about 5 cells and you want to show him having 2 Red and 2 green and 1 Away (for example)?
    Do you want to show each student (alphabetically) and then show how many of each color they have?
    ---
    Is exactly what I want.
    I could potentially put a number at the end of each name but I'm not sure how this would help calculate? I'm happy to hear your reasoning though!
    I'll also provide the example below (normally there would be more names but you'll get the picture):
    Pic_1.PNG
    So that would be one subject line for instance and then I would want to take that info and transfer it to another sheet via a count function of some sort to show something like this:
    Pic_2.PNG

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Counting Cell Colours and Content

    Hi Tim,

    I'll have to think about this some more. Colors simply aren't data, and therefore harder to work with. Your problem looks like a Crosstab table that needs to be UnPivoted to me, but a lot of problems look like that to me.

    It looks like you are trying to put about 7 things together. These would be:
    1. Student
    2. Subject
    3. Teacher
    4. Room
    5. Lesson
    6. Time
    7. Attendance category

    This looks like a 7 column table to me, that you are trying to fit in an area in Excel. I'll look tomorrow as it is late now.

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Counting Cell Colours and Content

    Please Login or Register  to view this content.
    To use ..

    =CountCellsByColor(B2:B100,F3,N2)

    B2:B100 list of Students/coloured cells

    F3= reference colour

    N2=Pupil

    so f3=Red colour, N2="John"

    will return count of cells in B2:B100 containing John and are RED
    Last edited by JohnTopley; 05-29-2017 at 03:57 AM.

  8. #8
    Registered User
    Join Date
    05-28-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    9

    Re: Counting Cell Colours and Content

    John my friend! That is fantastic! That is exactly what I needed.
    I just want to address MarvinP real quickly. Although we do have other fields as you've mentioned, I don't *need* to sort on those for my requirements. It would be nice, but it's not necessary.
    John you've given me the perfect answer, there's just one smaaall thing that maybe you can help me with?
    So I've tested your answer among many sheets and it works 100%, the one tiny thing. If I go in and change the colors of the cells *after* entering the forumla in a cell, it doesn't auto update. I have to go back into the cell and hit 'enter' before it updates the calculation, if you follow me?
    Is there any way to select a bunch of cells and 'update formulas'?
    Last edited by Tim52; 05-29-2017 at 08:15 PM.

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Counting Cell Colours and Content

    Try pressing F9.

  10. #10
    Registered User
    Join Date
    05-28-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    9

    Re: Counting Cell Colours and Content

    Quote Originally Posted by JohnTopley View Post
    Try pressing F9.
    Like magic!
    All done here lads.
    Principal is very happy.
    Appreciate the help! Will mark the thread as solved.

+ 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 Cell Colours
    By Willows in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 06-28-2014, 09:45 AM
  2. Counting numbers and colours within a cell
    By ibenam in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 02-06-2013, 11:30 AM
  3. Replies: 3
    Last Post: 06-19-2012, 04:55 AM
  4. changing cell colours depending on cell content
    By jon@karhu in forum Excel General
    Replies: 6
    Last Post: 11-19-2008, 10:47 AM
  5. Counting cells by colours rather than by content
    By wbleamas in forum Excel General
    Replies: 1
    Last Post: 11-02-2008, 04:23 AM
  6. Counting a cell based on the content of adjoining cell
    By themax16 in forum Excel General
    Replies: 6
    Last Post: 06-02-2008, 02:36 PM
  7. [SOLVED] Excel 2003 font colours and cell colours
    By bretta in forum Excel General
    Replies: 1
    Last Post: 04-16-2005, 11:06 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