Apr 08 2022 05:30 PM
I'm looking for a formula to return certain values when using excel. For instance:
Cell A1 would be 531
Cell B2 would be 185
I want to subtract but I want it to return 454 as the answer. So it would basically ignore the negative answer that should be returned. And it just focuses on the digit in each individual spot versus the number as a whole. 5 -1, 3-8 =8 - 3, and 1 - 5 = 8- 3
Apr 08 2022 07:38 PM
Apr 09 2022 10:59 AM
Apr 09 2022 11:57 AM
SolutionIf you're certain the two numbers have the same number of digits, a slightly shorter version:
=CONCAT(ABS(MID(A1,SEQUENCE(LEN(A1)),1)-MID(B2,SEQUENCE(LEN(A1)),1)))
Apr 09 2022 04:13 PM
Apr 09 2022 06:41 PM
@Hans Vogelaar this worked perfectly. It will always be a three digit number. Thank you so much.
Apr 09 2022 06:42 PM
Apr 09 2022 11:57 AM
SolutionIf you're certain the two numbers have the same number of digits, a slightly shorter version:
=CONCAT(ABS(MID(A1,SEQUENCE(LEN(A1)),1)-MID(B2,SEQUENCE(LEN(A1)),1)))