How to avoid spill error on Sumif

87th

New Member
Joined
Sep 8, 2024
Messages
2
Office Version
  1. 365
Platform
  1. MacOS
Hi,

I'm trying to create a formula in a table column that sums values based on a date/time range as long as the time difference between any values within the range and the value in the current row is roughly less than 2 minutes. The issue I'm running into is a spill error from said calculation which I would like to find a somewhat non-strenuous means of getting around.

Here is the current formula:
=SUMIF([Update Time],([Update Time]-[@[Update Time]])*1440<=2,[Amount])

Obviously haven't exhaustively completed the calculation, but my issue is really just the spill error. I understand the source of the error and everything, but I'm having a creative block at the moment so open to solutions that may change the methodology completely.

Thank you in advance for any thoughts/help.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hello, could you please upload a sample of your data so that we could see how it is structured (FILTER + SUM might be a way here)?
 
Last edited:
Upvote 0
Welcome to the MrExcel forum!

You have 2 issues. First, you can't have a Spill formula in a table. I can tell you're using a table by the form of your current formula. Second, when using SUMIF, the way you defined the comparison doesn't work. I tried remediating it with SUMIFS, but it got very long and complicated, so I moved to FILTER as hagia_sofia suggested.

Book1
ABC
1Update TimeAmountNear Sum
21:0013
31:0123
41:05316
51:1044
61:2055
71:06616
81:06716
91:30827
101:31927
111:321027
Sheet2
Cell Formulas
RangeFormula
C2:C11C2=SUM(FILTER([Amount],ABS([Update Time]-[@[Update Time]])*1440<=2))


Since a formula will automatically replicate down all rows in the table, you don't need to use a Spill formula. Let us know if this works for you. Also, you might want to subtract 1 from the answer, since each row will count itself.
 
Upvote 0
Solution
Welcome to the MrExcel forum!

You have 2 issues. First, you can't have a Spill formula in a table. I can tell you're using a table by the form of your current formula. Second, when using SUMIF, the way you defined the comparison doesn't work. I tried remediating it with SUMIFS, but it got very long and complicated, so I moved to FILTER as hagia_sofia suggested.

Book1
ABC
1Update TimeAmountNear Sum
21:0013
31:0123
41:05316
51:1044
61:2055
71:06616
81:06716
91:30827
101:31927
111:321027
Sheet2
Cell Formulas
RangeFormula
C2:C11C2=SUM(FILTER([Amount],ABS([Update Time]-[@[Update Time]])*1440<=2))


Since a formula will automatically replicate down all rows in the table, you don't need to use a Spill formula. Let us know if this works for you. Also, you might want to subtract 1 from the answer, since each row will count itself.
The sum filter approach was exactly what I was looking for, thank you very much!
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

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