SCAN Function not working in Excel Table

Fowmy

Well-known Member
Joined
Jul 10, 2008
Messages
516
Office Version
  1. 365
Platform
  1. Windows
Hi

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.

Thanks
Fowmy
 

Attachments

  • RZYaaupe6M.png
    RZYaaupe6M.png
    39.4 KB · Views: 31

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
You can not use dynamic array formula's in structured tables. You can drag this down

Excel Formula:
=[@Sales]+IFERROR(--F2,0)
 
Last edited:
Upvote 0
Another option
Excel Formula:
=SUM(INDEX([sales],1):[@Sales])
 
Upvote 0
You can not use dynamic array formula's in structured tables. You can drag this down

Excel Formula:
=[@Sales]+IFERROR(--F2,0)
I think that's big limitation :(

Your formula works but I am waiting to see more replies.
I modified your formula as =[@Sales]+IFERROR(--F1,0)
 
Upvote 0
Yes it should be F1, and it is a limitation for sure.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
I think that's big limitation :(
I disagree. One of the features of a table is that you put a formula in the top cell of a column and it fills the table column with that formula. A dynamic array formula may use/require less or more rows than exist in the table. To me that doesn't fit with the workings of a table.

Related to the above, as a general rule I would recommend the formula from post 3 over the formula from post 2 because the post 2 formula does not use/stick to the table structure nomenclature. To demonstrate, here is a small table with both formulas and both returning correct running totals.

Fowmy.xlsm
DEF
1SalesRTRT2
2666
351111
421313
531616
Sheet1
Cell Formulas
RangeFormula
E2:E5E2=[@Sales]+IFERROR(--E1,0)
F2:F5F2=SUM(INDEX([Sales],1):[@Sales])


Of course one of the features of a table structure is that table rows can be added or deleted. If I right-click, say, E3 and "Delete -> Table Rows" this is what I get. Col E now returns incorrect results.

Fowmy.xlsm
DEF
1SalesRTRT2
2666
3228
43511
Sheet1
Cell Formulas
RangeFormula
E2,E4E2=[@Sales]+IFERROR(--E1,0)
F2:F4F2=SUM(INDEX([Sales],1):[@Sales])
E3E3=[@Sales]+IFERROR(--#REF!,0)
 
Upvote 0
I figured it out, REDUCE can be used this way which allows me to customize the calculation within LAMBDA:
 

Attachments

  • EXCEL_75yiUBJDyl.png
    EXCEL_75yiUBJDyl.png
    38 KB · Views: 13
Upvote 0
Why use reduce, rather than just sum, I think it would be far less efficient.
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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