Get financial month's quarter from date

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,602
Office Version
  1. 365
Platform
  1. Windows
Hey all

NDA.xlsm
ABCDEFGHIJKLM
1DATEMONTHQSALES2021/222022/23MONTHNQ
203-Sep-21Sep2600Q101625JAN14
314-Dec-21Dec3299Q26000FEB24
415-Jan-22Jan41725Q3299275MAR34
501-Feb-22Feb41425Q445500APR41
625-Feb-22Feb41075MAY51
712-Mar-22Mar4325JUN61
812-Jun-22Jun11500JUL72
919-Jun-22Jun1125AUG82
1002-Sep-22Sep20SEP92
1103-Dec-22Dec3275OCT103
12NOV113
13DEC123
14
15
Data (3)
Cell Formulas
RangeFormula
B2:B11B2=IF(ISBLANK(A2),"",TEXT(A2,"MMM"))
C2:C11C2=IF(ISBLANK(A2),"",VLOOKUP(B2,$J$2:$L$13,3,FALSE))


My Data as shown in this sample consists of a list of dates in COLUMN A , the month for that date in COLUMN B, a formula to get the quater number in COLUMN C and the sales totals for that date in COLUMN D

Is there a formula that can generate the totals as shown in cells G2:H5 that will show the totals sales for each financial quarter in a certain year, like year 2021/22 and 2022/23 as shown?

Hope this makes sense and apprecite in advance
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
This should do what you need. Paste it in to all cells g2 to h5.
You then just need to adjust the "C2:C11=1" to be your quarterly number (where the 1 represents the quarter in the below code) for each cell
Do same for column H but and then adjust "Right($G$1,2*1" to "Right($H$!,2*1" for column H

Excel Formula:
=SUMPRODUCT((RIGHT((YEAR($A$2:$A$11)+(MONTH($A$2:$A$11)>=4)),2)*1<=RIGHT($G$1,2)*1)*($C$2:$C$11=1)*($D$2:$D$11))

breakdown of code is as follows

Excel Formula:
(RIGHT((YEAR($A$2:$A$11)+(MONTH($A$2:$A$11)>=4)),2)*1
gets the phys cal year for the Q

Excel Formula:
<=RIGHT($G$1,2)*1
checks for match to your year in G or H

Excel Formula:
($C$2:$C$11=1)
looks for which Q (in this case Q1)

Excel Formula:
($D$2:$D$11
refers to totals column
 
Upvote 0
Solution
@gordsky
many thanks for your help - works great, and appreciate the detailed explanation too!

Cheers
 
Upvote 0

Forum statistics

Threads
1,216,095
Messages
6,128,804
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top