We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Excel question again.

13»

Comments

  • aliasojo
    aliasojo Posts: 23,053 Forumite
    Part of the Furniture 10,000 Posts Combo Breaker
    Got another question. :D

    Is it possible to get Excel to recognise when it's a 4 week month or a 5 week month?

    I'm going to have two rows on my sheet. If it's a 4 week month I'll bold the 4 week figures or highlight in some other way and fade the 5 weeks figures. If it's a 5 week I'll highlight the 5 week figures.

    Is there a way of highlighting automatically using conditional formatting maybe?

    I've no idea if it's even possible to take dates/weeks into account on a spreadsheet. :D
    Herman - MP for all! :)
  • gb12345
    gb12345 Posts: 3,055 Forumite
    There's no built in function to return the number of weeks in a month, but it should be possible using the WEEKNUM function.

    Try this

    =IF(MONTH(NOW())<>12,WEEKNUM(DATE(YEAR(NOW()),MONTH(NOW())+1,1)),53)-WEEKNUM(DATE(YEAR(NOW()),MONTH(NOW()),1))

    Put it in a cell somewhere then do conditional formatting based on the value of that cell being 4 or 5 (don't know what version of Excel you are using this works in 2013, but I can't remember if you can do this in earlier versions).
  • aliasojo
    aliasojo Posts: 23,053 Forumite
    Part of the Furniture 10,000 Posts Combo Breaker
    gb12345 wrote: »
    There's no built in function to return the number of weeks in a month, but it should be possible using the WEEKNUM function.

    Try this

    =IF(MONTH(NOW())<>12,WEEKNUM(DATE(YEAR(NOW()),MONTH(NOW())+1,1)),53)-WEEKNUM(DATE(YEAR(NOW()),MONTH(NOW()),1))

    Put it in a cell somewhere then do conditional formatting based on the value of that cell being 4 or 5 (don't know what version of Excel you are using this works in 2013, but I can't remember if you can do this in earlier versions).

    I'm using 2010.

    Thanks..will try that shortly.
    Herman - MP for all! :)
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 352.1K Banking & Borrowing
  • 253.6K Reduce Debt & Boost Income
  • 454.2K Spending & Discounts
  • 245.1K Work, Benefits & Business
  • 600.8K Mortgages, Homes & Bills
  • 177.5K Life & Family
  • 258.9K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.1K Discuss & Feedback
  • 37.6K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.