"How can I change the ranges on these functions?"

Sikandar Ali

New Member
Joined
Nov 22, 2020
Messages
12
Office Version
  1. 2019
Platform
  1. Windows
Book2
ABCDEFGHIJKLMN
1ObservationI want to calculate the following indices from above Observation data
2DatePrecDataStatistics \SeasonsMean (mm/ day)SD (mm/ day)Percentile (99th)5-day max rainfall (mm)% Wet daysMax dry spell lengthMax wet spell length
31/1/19770
41/2/19770
51/3/19770Observation Annual2.8997753410.314940560.706179.0720%685offsetmax
61/4/19770Winter=(Oct-March)0.901560443.8771442622.072673.669%63425
71/5/197703month=(April-June)2.961472538.3968010136.70390.1722%15582
81/6/197703months(July-Sept)6.7917391317.397064279.5401179.0739%10552
91/7/19770
101/8/19770
111/9/19770
Sheet4
Cell Formulas
RangeFormula
F5F5=AVERAGE(B3:B367)
G5G5=STDEV.S(B3:B367)
H5H5=PERCENTILE($B$3:$B$367,0.99)
I5I5=AGGREGATE(14,6,SUBTOTAL(9,OFFSET($B$3,ROW($B$3:$B$363)-ROW($B$3),0,5)),1)
J5J5=COUNTIF(B3:B367,">.1")/365
K5K5=MAX(FREQUENCY(IF($B$3:$B$367<0.1,ROW($B$3:$B$367)),IF($B$3:$B$367>=0.1,ROW($B$3:$B$367))))
L5L5=MAX(FREQUENCY(IF($B$3:$B$367>=0.1,ROW($B$3:$B$367)),IF($B$3:$B$367<0.1,ROW($B$3:$B$367))))
F6:F8F6=SUMPRODUCT($B$3:$B$367,--(MOD(MONTH($A$3:$A$367)+M6,12)<=N6))/SUMPRODUCT(--(MOD(MONTH($A$3:$A$367)+M6,12)<=N6))
G6:G8G6=STDEV.S(IF(MOD(MONTH($A$3:$A$367)+M6,12)<=N6,$B$3:$B$367))
H6:H8H6=PERCENTILE(IF(MOD(MONTH($A$3:$A$367)+M6,12)<=N6,$B$3:$B$367),0.99)
I6:I8I6=AGGREGATE(14,6,IF(MOD(MONTH($A$3:$A$367)+M6,12)<=N6,SUBTOTAL(9,OFFSET($B$3,ROW($B$3:$B$363)-ROW($B$3),0,5))),1)
J6:J8J6=SUMPRODUCT(--($B$3:$B$367>=0.1),--(MOD(MONTH($A$3:$A$367)+M6,12)<=N6))/SUMPRODUCT(--(MOD(MONTH($A$3:$A$367)+M6,12)<=N6))
K6:K8K6=MAX(FREQUENCY(IF(($B$3:$B$367<0.1)*(MOD(MONTH($A$3:$A$367)+M6,12)<=N6),ROW($B$3:$B$367)),IF($B$3:$B$367>=0.1,ROW($B$3:$B$367))))
L6:L8L6=MAX(FREQUENCY(IF(($B$3:$B$367>=0.1)*(MOD(MONTH($A$3:$A$367)+M6,12)<=N6),ROW($B$3:$B$367)),IF($B$3:$B$367<0.1,ROW($B$3:$B$367))))
Press CTRL+SHIFT+ENTER to enter array formulas.
Dear experts,
I need your help to modify the ranges like winter from Oct-March to Oct-Feb and 3months from April-June to 4months March-June, remaining (July-Sep) will be same. So kindly help me in this regard, your kind assistance will be highly appreciated.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
The rules for the offset and max column are as follows:

Offset:
Convert the starting month to a number (October = 10), and subtract from 12. So M6 = 2.

Max:
The max column is the number of months you want to include in the range, minus 1. So Oct-Mar has 6 months (Oct, Nov, Dec, Jan, Feb, Mar), subtract 1 and you get 5, which is what N6 says. If you want 5 months (Oct-Feb), change N6 to 4.

You should be able to figure out the change to N7 you need to make.
 
Upvote 0
Solution
The rules for the offset and max column are as follows:

Offset:
Convert the starting month to a number (October = 10), and subtract from 12. So M6 = 2.

Max:
The max column is the number of months you want to include in the range, minus 1. So Oct-Mar has 6 months (Oct, Nov, Dec, Jan, Feb, Mar), subtract 1 and you get 5, which is what N6 says. If you want 5 months (Oct-Feb), change N6 to 4.

You should be able to figure out the change to N7 you need to make.Th
I got it and thank you very much for your fruitful response
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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