Forum Discussion

ColeF2070's avatar
ColeF2070
Copper Contributor
Aug 12, 2024

Lookup and Iterate

I have a dataset that i would like to use to lookup but I need to iterate between set values such as 1:03 that falls between 1:00 and 1:05 AFTER my time of concentration is greater than 1 hr. Any help would be greatly appreciated. 

 

D=0.48Duration of rainfall event (hours)
SI=0.02Slope of longest flow path (elevation difference between 10% and 85% of path length, divided by .75L)
Tc=00:29Time of concentration (This is the cell that is looked up on the table Column A)
*Tc is calculated using equation that assumes grass and aggregate-lined roads and ditches 
   
Recurrence Interval

(Intensity) first lookup value 

=LOOKUP(B19,'Riley County Rainfall Intensity'!A2:A117,'Riley County Rainfall Intensity'!B2:B117)

(Discharge)

(inches/hr)Qt (cfs)
2 year2.54 132 
5 year3.19265
10 year3.75390
25 year4.56598
50 year4.86698
100 year5.89919

 

Table Referenced

 

Time2yr5yr10yr25yr50yr100yr
00:055.797.268.5310.3711.8513.38
00:065.356.717.899.5810.9512.36
00:0756.277.378.9510.2311.55
00:084.715.96.948.439.6310.88
00:094.465.596.577.989.1210.3
00:104.245.316.257.598.679.79
00:114.045.075.967.248.279.34
00:123.864.855.76.927.918.93
00:133.714.655.476.657.598.57
00:143.574.485.266.47.318.25
00:153.444.325.086.177.057.96
00:163.344.194.935.996.847.72
00:173.254.084.795.826.657.51
00:183.163.974.675.676.477.31
00:193.093.874.555.536.317.13
00:203.013.784.445.46.166.96
00:212.943.694.345.276.026.8
00:222.883.614.245.155.896.65
00:232.813.534.155.045.766.5
00:242.753.464.064.945.646.37
00:252.73.393.984.845.536.24
00:262.643.323.94.745.426.12
00:272.593.253.834.655.316
00:282.543.193.754.565.215.89
00:292.493.133.684.485.125.78
00:302.443.073.614.395.025.68
00:312.43.023.554.324.945.58
00:322.362.973.494.254.865.49
00:332.322.923.434.184.785.41
00:342.282.873.384.114.715.32
00:352.252.823.324.054.635.24
00:362.212.783.273.984.565.16
00:372.182.733.223.924.495.09
00:382.142.693.173.864.425.01
00:392.112.653.123.84.364.94
00:402.082.613.073.754.34.87
00:412.052.573.033.694.234.8
00:422.022.532.983.644.174.73
00:431.992.492.943.594.124.67
00:441.962.462.93.544.064.61
00:451.932.422.863.4944.54
00:461.92.392.823.443.954.48
00:471.882.362.783.393.94.43
00:481.852.322.743.353.854.37
00:491.822.292.73.313.84.31
00:501.82.262.673.263.754.26
00:511.782.232.633.223.74.21
00:521.752.22.63.183.664.16
00:531.732.172.573.143.614.11
00:541.712.152.533.13.574.06
00:551.692.122.53.063.524.01
00:561.672.092.473.033.483.96
00:571.652.072.442.993.443.92
00:581.632.042.412.953.43.87
00:591.612.022.382.923.363.83
01:001.5922.362.893.323.78
01:051.511.892.242.743.163.6
01:101.441.82.132.613.013.43
01:151.371.722.032.52.883.28
01:201.311.651.942.392.753.14
01:251.261.581.862.292.643.02
01:301.211.511.792.22.542.9
01:351.161.461.722.122.452.79
01:401.121.41.662.042.362.69
01:451.081.351.61.972.282.6
01:501.041.311.551.912.22.52
01:551.011.271.51.852.132.44
02:000.981.231.451.792.072.37
02:050.951.191.411.742.012.3
02:100.921.161.371.691.962.24
02:150.91.131.341.651.912.18
02:200.871.11.31.61.862.13
02:250.851.071.271.561.812.08
02:300.831.041.241.531.772.03
02:350.811.021.211.491.731.98
02:400.7911.181.461.691.94
02:450.770.971.151.421.651.9
02:500.760.951.131.391.621.86
02:550.740.931.11.361.581.82
03:000.730.911.081.341.551.78
03:150.680.861.021.261.461.68
03:300.650.810.971.191.391.59
03:450.610.770.921.131.321.52
04:000.580.740.871.081.261.44
04:150.560.70.831.031.21.38
04:300.530.670.80.991.151.32
04:450.510.650.770.951.11.27
05:000.490.620.740.911.061.22
05:150.470.60.710.881.021.17
05:300.460.580.680.850.981.13
05:450.440.560.660.820.951.09
06:000.430.540.640.790.921.05
06:300.40.510.60.740.860.99
07:000.380.480.570.70.810.93
07:300.360.450.540.660.770.88
08:000.340.430.510.630.730.84
08:300.320.410.490.60.70.8
09:000.310.390.470.570.660.76
09:300.30.380.450.550.630.72
10:000.290.360.430.530.610.69
10:300.270.350.410.510.580.66
11:000.260.330.40.490.560.64
11:300.250.320.380.470.540.61
12:000.250.310.370.450.520.59
13:000.230.290.340.420.490.55
14:000.220.270.320.40.460.52
15:000.210.260.310.370.430.49
16:000.190.250.290.350.410.46
17:000.190.230.270.340.380.44
18:000.180.220.260.320.370.41
19:000.170.210.250.30.350.39
20:000.160.20.240.290.330.38
21:000.160.190.230.280.320.36
22:000.150.190.220.270.310.35
23:000.140.180.210.260.290.33
00:000.140.170.20.250.280.32
  • ColeF2070  ah. here is one option (I'll think and prob add another):

     

    =IFERROR(
    FORECAST.LINEAR(
       $L$3,
       INDEX('Riley County Rainfall Intensity'!$B$2:$G$117,MATCH($L$3-0.0001,'Riley County Rainfall Intensity'!$A$2:$A$117,1)+{0,1},ROW(K9)-ROW($K$8)),
       INDEX('Riley County Rainfall Intensity'!$A$2:$A$117,MATCH($L$3-0.0001,'Riley County Rainfall Intensity'!$A$2:$A$117,1)+{0,1})),
    "not found")

     

    and then drag down

     

    and an option using new array formula:

    =LET(in, G3,
    vals, CHOOSEROWS('Riley County Rainfall Intensity'!A2:G117,XMATCH(G3,'Riley County Rainfall Intensity'!A2:A117,-1)+{0,1}),
    diff, (in-INDEX(vals,1,1))/(INDEX(vals,2,1)-INDEX(vals,1,1)),
    DROP(TRANSPOSE(diff*(TAKE(vals,-1)-TAKE(vals,1))+TAKE(vals,1)),1)
    )

    but maybe someone else knows an easier way.

  • m_tarler's avatar
    m_tarler
    Steel Contributor

    ColeF2070  first I want to thank you for formatting that all in tables to make things easier.  next I think  what you want is to fill in the set of data from 2 year to 100 year based on that Tc= value. 

    That said I think you have some typos/error in that the lookup row you have is 1 below the data you listed except for the 50 year which is completely different row.

    In the attached I give 2 examples:

    using new 365 formula:

     

     

    =TRANSPOSE(XLOOKUP(G3,'Riley County Rainfall Intensity'!A2:A117,'Riley County Rainfall Intensity'!B2:G117,"not found",1))

     

     

    using older formula and then hit ctrl-shift-enter (and I think it will work but I can't test):

     

     

    =IFERROR(TRANSPOSE(INDEX('Riley County Rainfall Intensity'!B2:G117,MATCH(L3,'Riley County Rainfall Intensity'!A2:A117,1),0)),"not found")

     

     

     

    oops had to edit to find nearest.  Note: the newer XLOOKUP will let you easily select next larger or next lower but the older Match will only find next lower so if you want the next higher you can do a small minus then +1 to the index so something like this:

    =IFERROR(TRANSPOSE(INDEX('Riley County Rainfall Intensity'!B2:G117,MATCH(L3-0.001,'Riley County Rainfall Intensity'!A2:A117,1)+1,0)),"not found")
    • ColeF2070's avatar
      ColeF2070
      Copper Contributor

      m_tarler Thank you, I may very well have some errors lol, I am trying to get a result between two sets of values when the referenced cell is between the values on the table. (ie Time = 1:03 falls between time 1:00 and 1:05  so something that iterates with the givens. (1:05-1:00/1.51-1.59)=(1:05-1:03/1.51-x))

      • m_tarler's avatar
        m_tarler
        Steel Contributor

        ColeF2070  ah. here is one option (I'll think and prob add another):

         

        =IFERROR(
        FORECAST.LINEAR(
           $L$3,
           INDEX('Riley County Rainfall Intensity'!$B$2:$G$117,MATCH($L$3-0.0001,'Riley County Rainfall Intensity'!$A$2:$A$117,1)+{0,1},ROW(K9)-ROW($K$8)),
           INDEX('Riley County Rainfall Intensity'!$A$2:$A$117,MATCH($L$3-0.0001,'Riley County Rainfall Intensity'!$A$2:$A$117,1)+{0,1})),
        "not found")

         

        and then drag down

         

        and an option using new array formula:

        =LET(in, G3,
        vals, CHOOSEROWS('Riley County Rainfall Intensity'!A2:G117,XMATCH(G3,'Riley County Rainfall Intensity'!A2:A117,-1)+{0,1}),
        diff, (in-INDEX(vals,1,1))/(INDEX(vals,2,1)-INDEX(vals,1,1)),
        DROP(TRANSPOSE(diff*(TAKE(vals,-1)-TAKE(vals,1))+TAKE(vals,1)),1)
        )

        but maybe someone else knows an easier way.

Resources