+ Reply to Thread
Results 1 to 14 of 14

Inserting color into complex IF formula

  1. #1
    Registered User
    Join Date
    01-11-2013
    Location
    Tennessee
    MS-Off Ver
    Excel 2003
    Posts
    31

    Inserting color into complex IF formula

    I have a vacation calculator/ calendar that I am working on and need help with my last formula. To exp-lain why my formula is so complicated: Our vacation for 2012 carries over to April 1st 2013, after that all but 10 days expire. Those 10 days then expire on June 30th. On top of that, we get our new 2013 vacation on April 1st. With that said, the below is a written our version of what I need the formula to look like:

    If H2 is greater than 0 (meaning the person has 2012 vacation to carry over) then E16:E48, G16:G48, AND I16:I48 (these cells are the calendar) Should be the color blue (to represent 2012 vacation being used). This should only happen if the number 1 or .5 is typed into E16:E48, G16:G48, or I16:I48. And this should only happen up to the amount in cell H2 (the amount of days carrying over from 2012).
    Last edited by Ash87; 01-15-2013 at 12:46 PM.

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Inserting color into complex IF formula

    Please attach a workbook with a clear before and after.
    HTH
    Regards, Jeff

  3. #3
    Registered User
    Join Date
    01-11-2013
    Location
    Tennessee
    MS-Off Ver
    Excel 2003
    Posts
    31

    Re: Inserting color into complex IF formula

    Attached is what I am looking for. You will see on the Before tab that the vacation for each day is all black. The After tab shows what I would like it to look like. That is, that the remaining 2012 vacation (h2)to be indicated in blue when put into the calendar. When they have used their 2012 days, I would like the font for the rest of the 2012 calendar to switch to black instead of blue.
    Attached Files Attached Files

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Inserting color into complex IF formula

    See how this works...

    Conditional Formatting
    • Highlight applicable range >> E16:E48
    • Home Tab >> Styles >> Conditional Formatting
    • New Rule >> Use a formula to determine which cells to format
    • Edit the Rule Description: Format values where this formula is true: =AND(OR(E16=1,E16=0.5),$H$2>0)
    • Format… [Number, Font, Border, Fill]
    • Applies to >> =$E$16:$E$48,$G$16:$G$48,$I$16:$I$48
    • OK >> OK

  5. #5
    Registered User
    Join Date
    01-11-2013
    Location
    Tennessee
    MS-Off Ver
    Excel 2003
    Posts
    31

    Re: Inserting color into complex IF formula

    Hi Jeffrey, Thank you so much for your response. I got all the way to the second to last line "applies to". I could not find that option in the conditional formatting formula you told me to go to. I tried skipping it and just hitting okay and it just turned all the text in E16:E48 Blue.

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Inserting color into complex IF formula

    See if this helps on the After tab...
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-11-2013
    Location
    Tennessee
    MS-Off Ver
    Excel 2003
    Posts
    31

    Re: Inserting color into complex IF formula

    Hi Jeffrey, same thing. All numbers are still coming up in Blue, regardless of how many days are in cell H2. Is there something wrong with my excel setting that is making it not work properly?

    Thanks,

    Ashley

  8. #8
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Inserting color into complex IF formula

    Hi Ashley,

    It would help to see the formula you are working with and/or the show the attachment so I can see the formula there...

  9. #9
    Registered User
    Join Date
    01-11-2013
    Location
    Tennessee
    MS-Off Ver
    Excel 2003
    Posts
    31

    Re: Inserting color into complex IF formula

    Good Morning Jeff, what do you need me to do? Can you not see the document?

  10. #10
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Inserting color into complex IF formula

    Quote Originally Posted by Ash87 View Post
    If H2 is greater than 0 (meaning the person has 2012 vacation to carry over) then E16:E48, G16:G48, AND I16:I48 (these cells are the calendar) Should be the color blue (to represent 2012 vacation being used). This should only happen if the number 1 or .5 is typed into E16:E48, G16:G48, or I16:I48. And this should only happen up to the amount in cell H2 (the amount of days carrying over from 2012).
    Hi Ashley,

    The attachment in post #6, how is it not working right based on your requirements?

    In H2, as long as the number is greater than 0 the cells remain blue, but as soon as that number in H2 reads 0 then everything is black.

    I guess I must not be following what you actually need.

  11. #11
    Registered User
    Join Date
    01-11-2013
    Location
    Tennessee
    MS-Off Ver
    Excel 2003
    Posts
    31

    Re: Inserting color into complex IF formula

    Hi Jeff, Sorry I am terrible at explaining things. Let me give it another shot.

    Okay, so in the sample form H2 has a 9 in it, representing that this person has 9 days of 2012 vacation left.

    In this portion of the calendar(E16:E48, G16:G48, AND I16:I48), I will either put 1.0 representing 1 day of vacation or .5 representing a 1/2 day of vacation. I would like the vacation to be blue up to the number in H2, in this case 9. So if this person asked for 10 days of vacation, on the 10th day the font would change back to the color black from the color blue, representing that he is now using his 2013 vacation and has used up all his 2012 vacation. On the file that you sent, I typed in 10 days of vacation and all 10 days were blue even though in H2 the number was 9.
    Attached Files Attached Files

  12. #12
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Inserting color into complex IF formula

    Hi Ashley,

    That does make a little more sense, but my day is pretty busy at work so I'll look into it later to see if there is a viable solution.

  13. #13
    Registered User
    Join Date
    01-11-2013
    Location
    Tennessee
    MS-Off Ver
    Excel 2003
    Posts
    31

    Re: Inserting color into complex IF formula

    Hi Jeff,

    I was just wondering if you have had anymore time to take a look at this? I need to have this formula figured out by tomorrow and am starting to freak out a little.

    Thank you for your time,

    Ash

  14. #14
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Inserting color into complex IF formula

    hi Ash87. not sure if you are using Excel 2003 as your profile mentioned. not a very good solution. i made the formula only possible for Jan-Mar. formula at E16 to be:
    Please Login or Register  to view this content.
    basically, my 1st SUM is a variable range that increases as it goes down & changes columns when it moves to the right.
    my 2nd SUM is fixed at the whole range of column E, but only sums when looking at column G, which is Feb. this is to add Jan data only in Feb
    my 3rd SUM is the same as the 2nd one, but fixing at column G (Feb), when looking at column I (Mar). add Feb data only in Mar

    besides that, i make sure the entries are numbers & H2 is more than 0

    it would actually be better if all your cells are actually dates, not numbers. that would help you not manually key in. but please raise it in another thread if you need.
    Attached Files Attached Files

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

+ 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