1
votes

I have a cell, A1, with the formula:

="Revenue: $"&sum(B1:B5)

Let's say the sum of B1 through B5 is $100. I want to then create a cell, A2, with this formula referencing A1's result:

="Margin: $"&A1-25

The problem I'm encountering is that A1 includes text when I just want to include the resulting sum. How do I do this?

2

2 Answers

0
votes

Since the string is always a fixed length you can just say grab everything after the 11th character:

="Margin: $"&mid(A1,11,9^9)-25
0
votes

try:

="Margin: $"&REGEXEXTRACT(A1; "\$(.*)")-25

0