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

Full Example: https://docs.google.com/spreadsheets/d/1eikT6wwBSVfjxkXQeXWFjrkBgedAepAtXch-Fq_UdgQ

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

  • 1
    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
  • 1
    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

2 Answers 2


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)))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.