Find correct data based on date ranges

Shad99

New Member
Joined
Feb 8, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi All, I have been trying to work this out myself but I really do need help:)

Below is a table I made to work out the kg/DM(Dry matter in the grass) by just inserting the CM and the Date measured.
Have tried index formular but get #N/A error =INDEX($F$2:$O$6,MATCH(1,INDEX(($F$1:$T$1=A2)*(($D$2:$D$6<=B2)*(($E$2:$E$6>=B2)+($E$2:$E$6=""))),0,1),0))
1644362142781.png



CM MeasuredMeasured DateKG/DMSeason Start DatesSeason End Date
15​
14​
13​
12​
11​
10​
9​
8​
7​
6​
9​
24/01/2022​
#N/A​
23/09/2022​
15/11/2022​
3250​
3130​
3010​
2880​
2750​
2620​
2470​
2320​
2150​
1980​
10​
9/02/2022​
15/11/2022​
22/12/2022​
3930​
3740​
3550​
3350​
3150​
2960​
2750​
2540​
2330​
2110​
22/12/2022​
21/03/2022​
4610​
4340​
4080​
3820​
3560​
3290​
3030​
2770​
2500​
2240​
21/03/2022​
21/06/2022​
4210​
3970​
3720​
3480​
3240​
3000​
2750​
2510​
2270​
2020​
21/06/2022​
23/09/2022​
3050​
2890​
2730​
2580​
2420​
2260​
2100​
1940​
1780​
1620​
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi Shad99,

I think you mixed rows and columns together. INDEX needs a row then a column so for row I'm doing the dates <= and >= check and for column I'm looking for the CM in row 1.

I also note your season dates overlap by 1 day, some dates were 2022 but probably should be 2023 so I've made some changes.

Shad99.xlsx
ABCDEFGHIJKLMNO
1CM MeasuredMeasured DateKG/DMSeason Start DatesSeason End Date1514131211109876
2924-Dec-22303023-Sep-2215-Nov-223250313030102880275026202470232021501980
31009-Feb-23329016-Nov-2222-Dec-223930374035503350315029602750254023302110
4622-Sep-23162023-Dec-2221-Mar-234610434040803820356032903030277025002240
51523-Sep-22325022-Mar-2321-Jun-234210397037203480324030002750251022702020
61122-Mar-23324022-Jun-2323-Sep-233050289027302580242022602100194017801620
Sheet1
Cell Formulas
RangeFormula
C2:C6C2=INDEX($F$2:$O$6,MATCH(1,INDEX(($D$2:$D$6<=B2)*($E$2:$E$6>=B2),0,1),0),MATCH(A2,$F$1:$O$1,0))
 
Upvote 0
Another option
+Fluff 1.xlsm
ABCDEFGHIJKLMNO
1CM MeasuredMeasured DateKG/DMSeason Start DatesSeason End Date1514131211109876
2924/01/2022303023/09/202115/11/20213250313030102880275026202470232021501980
31002/09/2022226015/11/202122/12/20213930374035503350315029602750254023302110
422/12/202121/03/20224610434040803820356032903030277025002240
521/03/202221/06/20224210397037203480324030002750251022702020
621/06/202223/09/20223050289027302580242022602100194017801620
Primary
Cell Formulas
RangeFormula
C2:C3C2=FILTER(FILTER($F$2:$O$6,($D$2:$D$6<=B2)*($E$2:$E$6>=B2)),$F$1:$O$1=A2)
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,199
Members
449,072
Latest member
DW Draft

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