INDEX and MATCH formula for rainfall cessation

Thlama

New Member
Joined
Mar 24, 2021
Messages
11
Office Version
  1. 2016
Platform
  1. Windows
Greetings to all on this forum. I am trying to develop a formula that picks rainfall cessation date from series of daily rainfall data. I have done a formula which picks the start of rainfall once a sum of 51mm has been recorded from the start of the year. However, for cessation (offset) date, it should be the last recorded sum of 51(mm) before rainfall recedes for the year. Meaning from the 31st December till date of cessation. The correct formula should pick 2nd Oct as the cessation date since that is the date the rainfall receeds below 51mm. Thanks

DUTSE.xlsx
FGH
215DOYDateRainfall(mm)
2162141-Aug346.61
2172152-Aug340.72
2182163-Aug335.5
2192174-Aug323.12
2202185-Aug317.14
2212196-Aug299.43
2222207-Aug296.06
2232218-Aug294.59
2242229-Aug293.1
22522310-Aug291.8
22622411-Aug291.36
22722512-Aug289.91
22822613-Aug288.25
22922714-Aug286.05
23022815-Aug285.8
23122916-Aug285.66
23223017-Aug285.62
23323118-Aug285.44
23423219-Aug284.91
23523320-Aug278.6
23623421-Aug275.68
23723522-Aug274.62
23823623-Aug273.42
23923724-Aug271.39
24023825-Aug269.36
24123926-Aug262.3
24224027-Aug251.77
24324128-Aug234.21
24424229-Aug213.4
24524330-Aug206.51
24624431-Aug201.28
2472451-Sep192.56
2482462-Sep192.29
2492473-Sep187.25
2502484-Sep183.38
2512495-Sep173.1
2522506-Sep153.65
2532517-Sep144.68
2542528-Sep141.99
2552539-Sep139.83
25625410-Sep133.92
25725511-Sep132.66
25825612-Sep131.1
25925713-Sep130.44
26025814-Sep125.99
26125915-Sep115.41
26226016-Sep109.14
26326117-Sep93.41
26426218-Sep87.7
26526319-Sep87.09
26626420-Sep86.58
26726521-Sep86.33
26826622-Sep86.08
26926723-Sep85.49
27026824-Sep80.95
27126925-Sep77.73
27227026-Sep73.98
27327127-Sep69.77
27427228-Sep64.54
27527329-Sep63.83
27627430-Sep63.06
2772751-Oct58.65
2782762-Oct47.02
2792773-Oct40.65
2802784-Oct40.51
2812795-Oct40.49
2822806-Oct40.46
2832817-Oct40.44
2842828-Oct40.44
2852839-Oct36.95
28628410-Oct35.45
28728511-Oct32.73
28828612-Oct30.09
28928713-Oct28.17
29028814-Oct26.26
29128915-Oct23.35
29229016-Oct13.52
29329117-Oct13.04
29429218-Oct13.04
29529319-Oct13.04
29629420-Oct13.04
29729521-Oct13.04
29829622-Oct13.03
29929723-Oct13
30029824-Oct8.68
30129925-Oct5.02
30230026-Oct3.66
30330127-Oct2.09
30430228-Oct0.75
30530329-Oct0.53
30630430-Oct0.51
30730531-Oct0.44
3083061-Nov0.15
3093072-Nov0.08
3103083-Nov0.07
3113094-Nov0.07
3123105-Nov0.07
3133116-Nov0.07
3143127-Nov0.07
3153138-Nov0.07
3163149-Nov0.07
31731510-Nov0.07
31831611-Nov0.07
31931712-Nov0.06
32031813-Nov0.06
32131914-Nov0.06
32232015-Nov0.06
32332116-Nov0
32432217-Nov0
32532318-Nov0
32632419-Nov0
32732520-Nov0
32832621-Nov0
32932722-Nov0
33032823-Nov0
33132924-Nov0
33233025-Nov0
33333126-Nov0
33433227-Nov0
33533328-Nov0
33633429-Nov0
33733530-Nov0
3383361-Dec0
3393372-Dec0
3403383-Dec0
3413394-Dec0
3423405-Dec0
3433416-Dec0
3443427-Dec0
3453438-Dec0
3463449-Dec0
34734510-Dec0
34834611-Dec0
34934712-Dec0
35034813-Dec0
35134914-Dec0
35235015-Dec0
35335116-Dec0
35435217-Dec0
35535318-Dec0
35635419-Dec0
35735520-Dec0
35835621-Dec0
35935722-Dec0
36035823-Dec0
36135924-Dec0
36236025-Dec0
36336126-Dec0
36436227-Dec0
36536328-Dec0
36636429-Dec0
36736530-Dec0
START-CESSATION
Cell Formulas
RangeFormula
G216:G367G216=F216-DATE(YEAR(F216),1,1)+1
H216:H366H216=SUM('Rainfall Data'!$D216:D$367)
H367H367=SUM('Rainfall Data'!$D$367:D367)
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
try this:

Excel Formula:
=INDEX(G216:G318,1/(MAX(IFERROR(1/((ROW(H216:H318)-215)/(51>=H216:H318)),0))))

This works when the data starts in row 216, if you move the data you must update the row subtractor (currently 215).
 
Upvote 0
Another option:

Excel Formula:
=AGGREGATE(14,6,G216:G367/(H215:H366>=51)/(H216:H367<51),1)
@Eric W , I tried using Aggregate, but I was doing it with the ROW numbers, so I was getting value errors. I did not even think to just use the dates as you are. Thanks for showing this. Very insightful.
 
Upvote 0
try this:

Excel Formula:
=INDEX(G216:G318,1/(MAX(IFERROR(1/((ROW(H216:H318)-215)/(51>=H216:H318)),0))))

This works when the data starts in row 216, if you move the data you must update the row subtractor (currently 215).
Thank you Mr. Moo (laughing). This actually helped helped me realise not to use MATCH on a different data I am working on. Eric's formula delivered the result perfectly.
 
Upvote 0
Another option:

Excel Formula:
=AGGREGATE(14,6,G216:G367/(H215:H366>=51)/(H216:H367<51),1)
Thanks for the perfect solution. I never thought AGGREGATE alone could resolve this.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,195
Members
452,616
Latest member
intern444

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