+ Reply to Thread
Results 1 to 19 of 19

Cell Color Based on day of week data is entered

  1. #1
    Registered User
    Join Date
    05-05-2020
    Location
    US
    MS-Off Ver
    365
    Posts
    10

    Cell Color Based on day of week data is entered

    Hello,

    I have a workbook that I use for inventory return tracking. Each Day I scan Serial Numbers from several different device types into columns. The number of devices scanned is different each day, and different between device types. I highlight the cells based on they weekday the serial numbers were scanned in. I would like to have this done automatically.

    For example, when I scan devices Monday they would automatically highlight the Monday color, and the next day when I scan in data it would automatically highlight only those cells with the Tuesday color. And so on for the rest of the week.

    Is this possible without having to write a whole new version of Excel in VB? I can usually figure my way around things, but this would be great. Thanks in advance!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    10-05-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2019
    Posts
    74

    Re: Cell Color Based on day of week data is entered

    Hi bigdatapimp

    What is your preferred outcome? I think Conditional Formatting shall do the trick.

    1. Highlight the Column you wish to have the format (On my sample, Column I).
    2. Select "Conditional Formatting" > "New Rule..." > "Use a formula to determine which cells to format".
    3. On the box put "=WEEKDAY(I1)=2" then select "Format" > "Fill" > Select the color you want.

    Change the number on the formula according to the days you wish to highlight

    Monday is =WEEKDAY(I1)=2
    Tuesday is =WEEKDAY(I1)=3
    Wednesday is =WEEKDAY(I1)=4
    .....

    Hope it is what you're looking for.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-05-2020
    Location
    US
    MS-Off Ver
    365
    Posts
    10

    Re: Cell Color Based on day of week data is entered

    Thanks for helping. Not quite what I was looking for. The cells I want to have filled are going to be the cells that the data is actually scanned into. Each day I scan serial numbers from each device type into columns A-E. Each Column for a different type. Since there are different numbers for each type everyday they rows will not necessarily line up, so I would need a date column for each data column to do it that way. This would also require me to enter the date for each row, in multiple date columns. Unfortunately that defeats the purpose by creating much more work I am already doing by manually filling the cells.

    For example: Column A gets 5 serials scanned, column B gets 9, Column C get 3, Etc.

    So what I need is to be able to scan the serials and have the fill for each cell to be the color for that specific day as the data is entered. It really needs to be dependent only on they day of the week the data is originally scanned in. I have tried various different IF statements and conditional formatting and they all either just don't work, or change when I re-open the file the next day. I don't mind implementing VB or scripts, I just have no idea how to do that.

    Thanks again for any help

  4. #4
    Registered User
    Join Date
    04-26-2020
    Location
    Massachusetts
    MS-Off Ver
    Office 365
    Posts
    93

    Re: Cell Color Based on day of week data is entered

    What does your data look like in Columns A - D?
    These columns are formatted as Text and your formula =COUNTA(A2:A20) counts
    numbers.

    When I format Columns A - D to General and put some data in Columns A - D it
    seems to work; look at the attached Excel workbook and see if this does what you
    want.

    * Use the COUNT function to get the number of entries in a number field that is
    in a range or array of numbers.

    Don't forget to say "Thank You" to those who have helped you in your thread. If
    you wish, you can also reward them by clicking on their reputation star bottom
    left.

    If this resolves your problem then click on Thread Tools at the top and mark it
    solved.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-05-2020
    Location
    US
    MS-Off Ver
    365
    Posts
    10

    Re: Cell Color Based on day of week data is entered

    The counts for the daily totals work fine. The =COUNTA(A2:A20) would change per day depending on how many serial numbers are scanned. Each day has a total calculator for each row, to count the number of scanned devices. If that could be automated as well that would be fantastic but, that is is not really the issue. What I am trying to do is have the cells be highlighted automatically as the data is scanned, color depending on the day. Hikari was going in the right direction, but not quite what I am hoping for.

    to try and clarify further again:

    Column A is one device type, Column B is another, and so on. Each day different numbers of devices are scanned for each column. Once each days data is entered, I go back and highlight those cells in each column with the color for that weekday. What I would like is for the sheet to highlight those cell as the data is entered. So one Monday I scan X number of devices in, they are one color. Tuesday I scan another X number of devices and that data gets another color. And so on each day.

    I have created Macros to highlight selected Cells for each color, but that still requires me to manually select each range of cells in each column.

    Attached is an example of what the sheet could look like.

    Thanks again for the Help!
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Cell Color Based on day of week data is entered

    Selecting F3:K??? for conditional formatting and using this formula (for example) to turn Tuesday items green
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    It assumes you skip one row between dates
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  7. #7
    Registered User
    Join Date
    05-05-2020
    Location
    US
    MS-Off Ver
    365
    Posts
    10

    Re: Cell Color Based on day of week data is entered

    That seems to highlight the Daily Totals. What I am trying to highlight are cells that have the data that is being counted in the totals. The cells in Columns A-D, as I enter the data. so when a blank cell gets data scanned in, it then changes the highlighted color to the color that corresponds with the current weekday.

    If it is monday and I scan data into 5 cells in column A, 25 cells in Column B, 17 cells in Column C, and 7 in Column D. I would like each of those cells to automatically highlight one color. Then Tuesday I scan data into 40 cells in column A, 6 cells in Column B, 1 cells in Column C, and 23 in Column D. I would like these cells to automatically highlight another color, without the ones from Monday changing. And So on until Friday. As it is I manually highlight each range of cells in each column after scanning in all the data. If it did automatically as I scan the data in, it make mornings much less time consuming.


    Thanks again!

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Cell Color Based on day of week data is entered

    Okay, I misunderstood. So sounds like what you need is an event driven macro (upon pasting) that will check the day of the week of the pasting and then modifying the cell color appropriately. Sadly this is beyond me but I think there are many here that could accomplish this.

    I don't see a way to do this with Formulas or Conditional formatting.

  9. #9
    Registered User
    Join Date
    05-05-2020
    Location
    US
    MS-Off Ver
    365
    Posts
    10

    Re: Cell Color Based on day of week data is entered

    That is kind of what I was thinking. I can think through the logic to make it happen, but I have no idea how to turn that into a formula/script/conditional format. Thanks anyway for trying!

  10. #10
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Cell Color Based on day of week data is entered

    This might be too simple-minded of me - but:

    In the sheet module:

    Please Login or Register  to view this content.
    And in the standard module:

    Please Login or Register  to view this content.
    Last edited by xladept; 05-06-2020 at 06:03 PM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  11. #11
    Registered User
    Join Date
    05-05-2020
    Location
    US
    MS-Off Ver
    365
    Posts
    10

    Re: Cell Color Based on day of week data is entered

    I'm not entirely sure what is going on in that, but I put it in a sheet and it is MUCH closer to what I am looking for. If could change the fill color only when data is entered into the cell that would be great. As it is, any cell that is selected gets highlighted.

    Thank you for helping as well!

  12. #12
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Cell Color Based on day of week data is entered

    Thanks for the rep!

    You could just use the change event:

    Please Login or Register  to view this content.
    Or maybe the doubleclick after highlighting your selection:

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    05-05-2020
    Location
    US
    MS-Off Ver
    365
    Posts
    10

    Re: Cell Color Based on day of week data is entered

    Even Closer! That might even be what I needed. It doesn't highlight the 1st cell, but that isn't the end of the world. Can you explain how it is controlling the Highlight Color? As of right now, using that script, it is highlighting with the color I normally use for Thursday. As it is, will it be a different color tomorrow?

    Thank you again! I have been beating my head against this one for weeks.

  14. #14
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Cell Color Based on day of week data is entered

    Starting with 0 - I indexed from 1 but the first array element is actually zero - my bad, here's the fix

    Please Login or Register  to view this content.
    please forgive me
    Last edited by xladept; 05-07-2020 at 11:04 AM.

  15. #15
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Cell Color Based on day of week data is entered

    I was double-checking and have some modifications:

    For the module

    Please Login or Register  to view this content.
    For the sheet:

    Please Login or Register  to view this content.
    Last edited by xladept; 05-07-2020 at 11:09 AM.

  16. #16
    Registered User
    Join Date
    05-05-2020
    Location
    US
    MS-Off Ver
    365
    Posts
    10

    Re: Cell Color Based on day of week data is entered

    That is even closer to what I am looking for! You are a champion among men. With this will the fill color change depending on the day of the week? That is pretty much the only other thing I would like it to do. I don't really do the whole script thing, so I am unsure by looking at it.

    Thank you again!

  17. #17
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Cell Color Based on day of week data is entered

    You're welcome and thanks for the rep!

    Yes the fill color should change daily (But Saturday and Sunday would have the same color).

    BTW - If that does it, please use thread tools and mark this thread as solved.
    Last edited by xladept; 05-07-2020 at 01:19 PM.

  18. #18
    Registered User
    Join Date
    05-05-2020
    Location
    US
    MS-Off Ver
    365
    Posts
    10

    Re: Cell Color Based on day of week data is entered

    That is Outstanding! Thank you very much. That saves me time, and a ton of frustration trying to figure this out.

  19. #19
    Registered User
    Join Date
    05-05-2020
    Location
    US
    MS-Off Ver
    365
    Posts
    10

    Re: Cell Color Based on day of week data is entered

    Thank you xladept your solution was exactly what I was looking for. In fact I was able to use it in another sheet as well. This will add up to days of saved time in the long Run! I greatly appreciate all the help.

+ 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. Based off color cell will have word entered.
    By thursday140 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-28-2018, 07:04 AM
  2. [SOLVED] Based on the color of a cell value should be entered in the next cell
    By jeevanarivu in forum Excel General
    Replies: 2
    Last Post: 09-01-2015, 02:49 AM
  3. Replies: 1
    Last Post: 03-18-2015, 03:37 PM
  4. Color code cell containing a date based on day of week
    By hvercillo in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 01-05-2014, 08:21 PM
  5. Color Code Cell Containing Date Based on Day of Week
    By hvercillo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-04-2014, 05:58 AM
  6. Color Coding Cells - Based on Time Since Entered Data
    By oojrod06oo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-16-2013, 07:08 AM
  7. Change Cell Color based on Day of the week
    By evenings in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-07-2010, 03:18 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