DatePart- function "Quarter"

imfarhan

Board Regular
Joined
Jan 29, 2010
Messages
102
Hi
If I'm right we are in Quarter =1 ,so why my following query brings the result quarter=2 ?

Select
DatePart("q",Now()) AS Financial_Quarter,
"01/04/" & IIf(DatePart("q",Now())=1,Year(Now())-1,Year(Now())) As Fi
FROM Table_Name

Ans= 2 ?

Thanks in advance

Many thanks
Farhan
 

Some videos you may like

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
54,178
Office Version
365
Platform
Windows
If I'm right we are in Quarter =1 ,so why my following query brings the result quarter=2 ?
No, we are actually in the second quarter now. The first quarter ended March 31 and the second quarter started April 1. Today is April 8, putting us in the second quarter.
 

imfarhan

Board Regular
Joined
Jan 29, 2010
Messages
102
I think bit confusion, the starting quarter of the Financial/fiscal year is
Apr to Jun = 1st Quarter
Jul to Sep = 2nd Quarter
Oct to Dec = 3rd Quarter
Jan to March = 4th Quarter

As per above rule the current quarter should be " 1 " using today's date i.e. 08/Apr/2010

Sorry , bit mixing the financial jargon wording

Many thanks
Farhan
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
54,178
Office Version
365
Platform
Windows
Ah, you didn't mention that you were dealing with a non-standard quarter calendar.

Something like this calculation should work:
Code:
IIf(DatePart("q",Now())=4,1,DatePart("q",Now())+1)
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,550
Messages
5,512,019
Members
408,872
Latest member
Lorid24

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top