Its Home work time folks. Sharpen your Excel pencils and get cracking.
![Write a formula to check if two dates are same month? [homework]](https://img.chandoo.org/hw/check-two-dates-in-same-month-excel-homework.png)
Find out if 2 dates are in same month
Lets say you have 2 dates in A1, A2.
Q1. What formula tells us if both of them are in same month?
Both dates must be in same month & year!
Go ahead and post your answer in comments.
You think that was easy, try this then:
The above formula would be very easy for seasoned Excel pros. So I have 2 additional questions:
Q2. How to find out if n dates (A1:An) are in same month?
Q3. How to find if n dates (A1:An) are in a given date range – start date in B1, end date in B2?
Post your answers in comments
Go ahead and post your answers in comments. I am eager to see what creative, fun & awesome solutions you can come up with for this problem.
Click here to post your answer.
PS: Click here for more Excel home works, quizzes & challenges.
Clue: Click here for a clue. Got it?

















2 Responses to “Top 10 Power BI Interview Questions & Answers”
Hello...
In Power BI I have data that includes months by name only (e.g. May, April, December...)
I need to build charts etc. but i need the months to go chronologically... not alphabetically... I cannot seem to find the fix to this.... once again, my data does NOT have an actual date attached to it (like 02/01/2023)....only month names... can i use a helper table wher i id the month names as numbers 1 thru 12? and if so, how do i manage this to work for me ?
Thank you.
~Keith
You need to setup an extra table to map each month name to a running number. A simple 12 row table like
Jan 1
Feb 2
Mar 3
..
Dec 12
Then create a relationship between this month table and your month column
Now, go to "table view" in Power BI and set the sort by column to month number for the month name column on this new table.
Finally, use the new table's month name whenever you need to refer to the month name in the visuals.
They will be chronologically arranged.