1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

First Day in a Month

Discussion in 'Business Applications' started by Elliott57, Dec 28, 2009.

Thread Status:
Not open for further replies.
Advertisement
  1. Elliott57

    Elliott57 Thread Starter

    Joined:
    Dec 28, 2009
    Messages:
    5
    I have a media rota as an Excel spreadsheet for tech team activities for Sundays at my church. I want to highlight, using conditional formatting, the first Sunday of the month and to colour-band alternate months. I could do this manually each time I issue the rota, but it would save a little time if the colours could automatically be set when I determine the activity dates. The rota covers four months at a time (see attached).

    I set the starting date by typing into cell A5. I know how to use Conditional Formatting but don't know how to calculate the first Sunday. The "first Sunday" formatting would of course be applied to all dates in the A column, and the banding to all cells between A5 and F22, so there are four cells that would need to accommodate both - but maybe I'm running before I can walk!

    I use Excel in Office 2003, running under WinXPPro. I am an experienced Excel user, but I don't do VBA.
     

    Attached Files:

  2. bomb #21

    bomb #21

    Joined:
    Jul 1, 2005
    Messages:
    8,546
    Welcome to the board.

    "The "first Sunday" formatting would of course be applied to all dates in the A column"

    OK.

    "I know how to use Conditional Formatting but don't know how to calculate the first Sunday."

    There's surely a way -- but you don't need to.

    Conditional formatting formula for A5:An -

    =AND(A5<>"",OR(A4="",MONTH(A5)>MONTH(A4)))

    ETA:

    Forgot the alternate month banding. :eek:

    Select B5:B22. Type:

    =ISEVEN(MONTH(A5))

    , press CTRL+Enter.

    Jan = False, Feb = True, Mar = False, etc. ;)
     
  3. Elliott57

    Elliott57 Thread Starter

    Joined:
    Dec 28, 2009
    Messages:
    5
    Thanks for the welcome.

    Yeah - good. Thanks. Didn't think like that at all, but I understand your logic.

    Having some trouble with this. Installed the Analysis Toolpak add-in ok. Don't understand what the Ctrl+Enter does for me (although something in the dim & distant ...)

    Anyway, I get an Excel error because the formula is not recognised (the "iseven" part does not get capitalised):

    You may not use references to other worksheets or workbooks for Conditional Formatting criteria.

    Well I know this this - I read it in the Help - and I don't want or need to, so what does Excel think I'm doing?

    I can paste this conditional format as a formula in the adjacent column and it displays "TRUE" for the even months and "FALSE" for the odd months.

    I get the same error message if I modify the CF to =iseven(a5). Doesn't matter whether I click OK or press Ctrl+Enter.
     
  4. bomb #21

    bomb #21

    Joined:
    Jul 1, 2005
    Messages:
    8,546
    Ctrl+Enter is just a shortcut for entering a formula in >1 cell simultaneously. Not important.

    "Anyway, I get an Excel error because the formula is not recognised (the "iseven" part does not get capitalised):

    You may not use references to other worksheets or workbooks for Conditional Formatting criteria.

    Well I know this this - I read it in the Help - and I don't want or need to, so what does Excel think I'm doing?"

    I have no idea. :D

    Try an "ATP-free" formula.

    =MOD(MONTH($A5),2)

    Returns 1 for "odd" months, 0 for "even" months. Or if it can't even handle MOD, then:

    =IF(ISNA(MATCH(MONTH($A5),{1;3;5;7;9;11},0)),0,1)

    HTH :)
     
  5. Elliott57

    Elliott57 Thread Starter

    Joined:
    Dec 28, 2009
    Messages:
    5
    "=MOD(MONTH($A5),2)"

    Yeah, that works fine. Thanks. CF seems fussy but there's nothing to suggest it in the Help.
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/888907

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice