Aug 31 2023 08:27 AM
Is there a way to get the sum value for number ranges for example calculating income for James $21,000 - $26,000, Mary $15,000 - $20,000, and Mark $50,000 - $55,000. I want to add these income ranges using a formula but am unsure if this is possible, since when I attempt to calculate them by using the formula =SUM(A2:A4) the answer keeps coming back to $0.
Aug 31 2023 08:42 AM
Aug 31 2023 09:25 AM
SolutionIt sounds like the cells with the amounts are text. I recommend arranging the data like this to simplify things:
Aug 31 2023 09:47 AM
Jan 14 2024 02:13 AM
This is unlikely to be the best solution for you, but there is a trick that allows number ranges separated with minus (hyphen) to be broken apart.
"Lower values"
= IMREAL(range&"i")
"Upper values"
= -IMAGINARY(range&"i")
First, however, you would need to strip out the dollar signs since they stop the strings being recognised as numbers.
Jan 14 2024 02:28 AM
The result is pretty crazy, but it works
= LET(
string, SUBSTITUTE(range, "$", "") & "i",
lower, IMREAL(string),
upper, -IMAGINARY(string),
CONCATENATE(TEXT(SUM(lower),"$#,##0"), "-", TEXT(SUM(upper),"$#,##0"))
)
Aug 31 2023 09:25 AM
SolutionIt sounds like the cells with the amounts are text. I recommend arranging the data like this to simplify things: