Sum and running totals of any numbers in selected text lines

I wish that were true – I've updated the macro in the original post at the top of this thread.

1 Like

It works great now. Thanks.

1 Like

Could you please help with a version that will do this only for USD amounts? The data will always come in the a form where \$(.*)\n would find what I am looking for. I was attempting to find a way with S&R in KM but this seems like maybe a solved problem for you all :sweat_smile:

image

This action will sum all the dollar values at the end of the lines.

If this isn't what you want, then provide a variety of inputs so we can see what you want to process.

Thank you; however, this is not giving the right results, here is a realistic example as requested:

 23-Aug-2021 9:26 pm
	CLOSED
	1
	
$1,016.50
	ID: F780KAP4QQZ8Y
22-Aug-2021 9:26 pm
	CLOSED
	1
	
$160.50
	ID: F780KAP4QQZ8Y
20-Aug-2021 9:26 pm
	CLOSED
	1
	
$240.00
	ID: F780KAP4QQZ8Y
18-Aug-2021 9:26 pm
	CLOSED
	3
	
$192.50
	ID: F780KAP4QQZ8Y
15-Aug-2021 9:26 pm
	CLOSED
	3
	
$36.80
	ID: F780KAP4QQZ8Y
13-Aug-2021 9:26 pm
	CLOSED
	1
	
$60.00
	ID: F780KAP4QQZ8Y
10-Aug-2021 9:26 pm
	CLOSED
	4
	
$6.00
	ID: F780KAP4QQZ8Y 

The result I am looking for would be $1,712.30 in this case. If it is possible to format the output as such with the dollar sign, comma and period as well that would be the icing on top.

This returns the right result:

_Sum Macro (v11.0.1)

_Sum.kmmacros (3.2 KB)

This assumes that the input will always be similar to your input. If it runs into problems on different kinds of input, I can probably adjust it to fit your new input.

2 Likes

This is perfect, thank you very much!

I've been using this for a few months now and it is working perfectly. Thank you again! Such a huge time saver.

1 Like

Thanks for the positive update. It makes me feel good that I helped.

1 Like