Pulling Data with 2 constraints

csliger931

New Member
Joined
Jul 22, 2020
Messages
21
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi,

I am trying to set up a calculation that calculates the flow RATE between dates where I actually have data. In the example table below, I have a total flow of 90 gallons on 05/05, and a total flow of 30 gallons on 05/02. Obviously, I don't want to have the formula set up to where its subtracting the row below it, because the row below it may be empty. So I need formula that will take the current flow for that day (i.e. 90 gallons) and then subtract the most previous date's flow (i.e, 30 gallons), and then divide that by the amount of days elapsed between those two entries (05/05 - 05/02 = 3). So, my final formula would result = (90-30)/(05/05-05/02) = 60/3 = 20 gal/day. Any ideas on how to do this? Keep in mind that the days between data collection may vary. I imagine that the winning formula is going to use the INDEX(2,1/) formula that seems to solve everything, but I have no idea how that would look (I'm still learning Excel basics). Anyways, I would greatly appreciate any help you Excel wizards could give me :D

Thanks!
Chris

DATEFLOW (gallons)RATE (gal/day)
05/0590=(B2-B5)/(A2-A5) ???
05/04
05/03
05/0230
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Would it be helpful to summarize? Then you could subtract the row below it. Dynamic array function filter has you enter one formula and it will spill down. Next to the spill area the simple rate formula would go.
scratchbook excel testing.xlsm
LMNOPQ
13DateFlowDateFlowRate
145-May905/5/20229020
154-May5/2/202230
163-May
172-May30
Sheet21
Cell Formulas
RangeFormula
O14:P15O14=FILTER(L14:M17,NOT(ISBLANK(M14:M17)))
Q14Q14=(P14-P15)/(O14-O15)
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,317
Members
449,081
Latest member
tanurai

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