CorrelateSpilled
New member
- Joined
- Apr 13, 2025
- Messages
- 13
- Reaction score
- 6
- Points
- 3
- Excel Version(s)
- 365 Online
Sorry for the late reply; I have been out of town for the past week.
I haven't gone through everything in the latest spreadsheet but for your Gallon Total (Column AX), the range you are COUNTIF is off. For example, in row 34 of your Gallon Total (Column AX), you are only COUNTIFS row 30; instead you should COUNTIF starting from row 34 (which is the first row of data in your spreadsheet) to row 249 (which is the last row of data in your spreadsheet). Also, I realized the OR within the formula was unnecessary so the formula can be simplified to:
Input the formula into cell AX34 (which is the first row of data) in the Gallon Total (column AX), then drag it down to the last row of data in that column. Also, for your Minimum Product Gallons (Column AW) it looks like you are COUNTIF and FILTERing the LoadingBOL (Column E) rather than the BillOfLadingId (Column A) so I think the formula should be:
Input the formula into cell AW34 (the first row of data in your Minimum Product Gallons column and drag it down to the last row of data.
I haven't gone through everything in the latest spreadsheet but for your Gallon Total (Column AX), the range you are COUNTIF is off. For example, in row 34 of your Gallon Total (Column AX), you are only COUNTIFS row 30; instead you should COUNTIF starting from row 34 (which is the first row of data in your spreadsheet) to row 249 (which is the last row of data in your spreadsheet). Also, I realized the OR within the formula was unnecessary so the formula can be simplified to:
Code:
=IF($AU34=COUNTIFS($A$34:$A249, $A34, $J$34:$J249, J34), SUMIFS($S$34:S249, $A$34:A249, A34, $J$34:J249, J34), 0)
Input the formula into cell AX34 (which is the first row of data) in the Gallon Total (column AX), then drag it down to the last row of data in that column. Also, for your Minimum Product Gallons (Column AW) it looks like you are COUNTIF and FILTERing the LoadingBOL (Column E) rather than the BillOfLadingId (Column A) so I think the formula should be:
Code:
=LET(loadFlag, IF(AU34=COUNTIF($A$34:A40, A34), SUM(UNIQUE(FILTER($AV$34:AV40, ($A$34:A40=A34), 0))), 0), IFS(loadFlag=0, 0, loadFlag=1, MAX(8500, F34), loadFlag=2, MAX(7200, F34), loadFlag=3, MAX(8000, F34)))
Input the formula into cell AW34 (the first row of data in your Minimum Product Gallons column and drag it down to the last row of data.
Last edited: