+ Reply to Thread
Results 1 to 9 of 9

Excel formula and cell background color?

  1. #1
    Registered User
    Join Date
    10-17-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    6

    Question Excel formula and cell background color?

    I would like to know if this is possible and kindly show me how to do it. Here's the thing, I crated an excel inventory and tracking them how long the item remains in my excel. For example, when a certain Item reached its 2nd day, the background color is green then if a certain item last for 3days or more then the row cells color background will turned red.

    Please let me know how to do it and kindly give me samples thank you.

    I tried conditional formatting but this is not what I wanted, it only turns the background color if a certain cell returned a TRUE value. I wanted for example ROWS A1 to Z1 be highlighted if the item lasted a certain day/s.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Excel formula and cell background color?

    conditional formatting IS what you need for this, you just have to get the formula doing what you want it to do. CF does work on a TRUE/FALSE answer, so you have to formulate your formula to give that answer

    so for instance, if you are comparing a date somewhere in your sheet with todays date, your formula would be something like...

    =a1<today()-2

    if you have a sample workbook to upload, i will walk you through the process?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Valued Forum Contributor
    Join Date
    08-14-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    573

    Re: Excel formula and cell background color?

    Hi, You can still use conditional formatting to highlight A1 to Z1. Check the attached file. I have used two CF, assuming your dates are in A column. You need to select your entire data range and add these formula.
    1. =today()-$A2=2 for Green colour
    2. =today()-$A2>2 for red colour
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    10-17-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    6

    Exclamation Re: Excel formula and cell background color?

    I tried both of your solutions and it helped giving me some idea but what I really want to do seems not working. I attached a sample sheet and hope you can help me more on this, thank in advance.
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor
    Join Date
    08-14-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    573

    Re: Excel formula and cell background color?

    Check the conditional formatting formulas in the attached sheet.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-17-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Excel formula and cell background color?

    @Sindhus - I loved what you have done and I had an idea like this before but I hesitated. What you have attached was a great reference but I would like to ask more if you don't mind. Probably I will put a lot of data here so if I follow what you have done, it will take me a lot of time to add rules for each row. Is there a way or formula that when I put a new data, it will automatically change when time passed? Or I will do all of it manually like what you have done?

    Cheers.

  7. #7
    Registered User
    Join Date
    10-18-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Excel formula and cell background color?

    Hi,

    Can you please share some WORK To Do sheet...

  8. #8
    Registered User
    Join Date
    10-18-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Excel formula and cell background color?

    Impressive!!!! Good One!!!

  9. #9
    Valued Forum Contributor
    Join Date
    08-14-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    573

    Re: Excel formula and cell background color?

    But you have to specify which formatting you want for which condition rite? If you make the conditional formating apply to all the rows in the sheet, whenever you enter new data, it will verify the condition and colour accordingly. You need not enter this again and again.

    Freeze your conditions and enter it. It is a one time activity. If my understanding about your requirement is wrong, please let me know.

    Quote Originally Posted by ishialoshaun View Post
    @Sindhus - I loved what you have done and I had an idea like this before but I hesitated. What you have attached was a great reference but I would like to ask more if you don't mind. Probably I will put a lot of data here so if I follow what you have done, it will take me a lot of time to add rules for each row. Is there a way or formula that when I put a new data, it will automatically change when time passed? Or I will do all of it manually like what you have done?

    Cheers.

+ 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