# Calculating numerical difference between two text arrays

Does PanX have a function or trick to easily calculate the difference between two simple text arrays where each array consists of a single elements or row, and each row consists of four tab delimited items, all numbers in the form of text?

There is no such function that I am aware of, if I am understanding your requirements correctly.

I am sure one could build a formula to do something like this, but could you explain in more detail what “the difference between two text arrays” means? if you have arrays a,b,c,d and e,f,g,h, do you mean (a+b+c+d)-(e+f+g+h), or (a-e)+(b-f)+(c-g)+(d-h), or something else?

Thanks for the reply. I have two text arrays, A1 and A2, like:

A1: a + tab() + b + tab() + c + tab() + d
and
A2: w + tab() + x + tab() + y + tab() + z

The result needs to be:
A3: a-w + tab() + b-x + tab() + c-y + tab() + d-z

Since Jim said there is no function, I’m thinking or using a formula to calculate a-w: val(tabarray(A1,1) - val(tabarray(A2,1) where A1 and A2 are the two arrays. Maybe there is a better way.

Arrayfilter might be better.

``A3 = arrayfilter(A1,tab(),{val(import())-val(tabarray(A2,seq()))})``

Dave, I think you forgot to quote the formula in the arrayfilter( function.

``A3 = arrayfilter(A1,tab(),{val(import())-val(tabarray(A2,seq()))})``

Guilty as charged. Now corrected.