# Formula that calculates the difference between numbers

I'm trying to create a formula that would be able to calculate the difference between the numbers and writes it exactly as shown in this image: https://i.postimg.cc/W4cZDgD2/image.png

I sew home-made large stuffed animals and I need it to evenly sew some parts.

• Welcome to Web Applications Stack Exchange. The desired results shown in the sample spreadsheet do not appear consistent. If they really are the correct results, please explain why the patterns shown in the desired results differ between the first two and the last two cases. Nov 26, 2023 at 21:39
• Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
– Community Bot
Nov 26, 2023 at 22:53

This formula will match the first two cases:

``````=arrayformula(join(" - "; filter(C4:K4 - B4:J4; isnumber(C4:K4)); B4))
``````

This formula will match the last two cases:

``````=arrayformula(join(" - "; B4; filter(C4:K4 - B4:J4; isnumber(C4:K4))))
``````

The following formula will work for all the variations.

# Locale: Czechia, France, etc.

Any locale that uses `,` as the decimal separator

``````=LET(r;A10:J10; JOIN(" - ";
FILTER({r\0}-{0\r}; LEN({r\""})>0)))
``````

# Locale: North America

Any locale that uses `.` as the decimal separator

``````LET(r,A10:J10, JOIN(" - ",
FILTER({r,0}-{0,r}, LEN({r,""})>0)))
``````