How to make the SCAN function work in an Excel table? I am trying to get the running total but not getting the expected results. This works with ranges.
Whilst you have used a 'new' function to achieve the running total you wanted, it is not quite the same thing that you were attempting with the SCAN function. If SCAN was successful then it it would have spilled all the results down the table from the top cell, just as it does for a range as you mentioned in post 1. REDUCE does not do that, even for a range - see below.
Here is a 'range' example to demonstrate. Each formula is entered in a single cell. Only SCAN produces a result for each row of the input range. The O16 formula also uses the whole range as input but only produces the final sum of the column. The P16 formula is the equivalent of what you have shown in post 9 and only produces a result for that single cell that it is entered in (unless copied down each row). It 'works' in your table for the same reason that an 'ordinary' formula does, the formula is automatically copied down the table column calculating a single result on each line, not a spilled result from the top cell.
Agreed. I just did a test. In col S below, 1000 rows with random numbers 1-99.
Col S with equivalent of post 6 formula: 0.013 seconds to recalculate the 1000 results
Col T with equivalent of post 9 formula: 0.345 seconds to recalculate the 1000 results. ie About 26 times slower.
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.