# extract numbers from formula in excel

#### littlepuppy

##### New Member
Hey guys,

I want to extract the numbers out from the formula in excel.
For example,

30=9+8+7+6 the number in the cell is 30. The 30 comes from 4 different numbers. I want to get each of the number out separately, like 9, 8, 7, and 6. each of them separately.

8,450,668.83=38062098.32-29611347.24-82.25
Same as here. The cell number 8,450,668.83 comes from three different numbers. How to get 38062098.32, -29611347.24, -82.25 out and each of them separately.

Thank you

### Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi.

Not sure I understand. What's actually in the cell? The formula:

=9+8+7+6

?

Regards

If I understand your question correctly, give this macro a try...
Code:
``````Sub GetNumbersFromSimpleFormula()
Dim Frmla As String, Cell As Range, Nums As Variant
For Each Cell In Range("A1", Cells(Rows.Count, "A").End(xlUp))
Frmla = Cell.Formula
Nums = Split(Replace(Mid(Frmla, 2), "-", "+"), "+")
With Cell.Offset(, 1).Resize(, UBound(Nums) + 1)
.Value = Nums
.Value = .Value
End With
Next
End Sub``````

Hi.

Not sure I understand. What's actually in the cell? The formula:

=9+8+7+6

?

Regards

yes, the cell shows up 30. but you click the cell, the cell contents a formula which is "=9+8+7+6".

Replies
34
Views
1K
Replies
5
Views
272
Replies
10
Views
566
Replies
9
Views
652
Replies
29
Views
965

1,211,868
Messages
6,104,467
Members
447,910
Latest member
abrook1308

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back