Jump to content
UBot Underground

Adding all items in a list


Recommended Posts

Okay, so what's the best way to get the sum of all items in a list. Let's say I have a list of 20k numerical values. Every list item (except for the first one is a column header since this is coming from a csv) is a number and I want to calculate the total of all those numbers.

 

Thanks in advance for any tips you can offer!

Link to post
Share on other sites

I think this should work, didnt test it though.

 

set(#count, 0, "Global")

set list position(%yourList, 1)

loop($subtract($list total(%yourList), 1)) {

set(#count, $add(#count, $next list item(%yourList)), "Global")

}

  • Like 2
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...