Extract data from formula not from the results of the formula

excel?

Board Regular
Joined
Sep 14, 2004
Messages
143
Office Version
  1. 365
Platform
  1. Windows
I have a formula that pulls text from another file. I want to pull a number from the Formula but instead I get the section from the text the formula is returning. Any suggestions on how to get the number not the text?

Formula (in Cell C14):
='[2021 Data Sheet.xlsm]30246'!$C$6

Data formula returns:
Red Small Apples -Red Delicious

I want to pull the number 30246 from the formula. I tried to use the MID formula, but it returns the Text data not the number form the formula.
=MID(C14,23,5) returns Delic not 30246.

I would appreciate any suggestions you might have. Thank you
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
By default, formulas run against the value in the cells, not the text of the formula.
However, there is a FORMULATEXT function that will allow you to do this, provided that you are using a new enough version of Excel (see here: FORMULATEXT function)

I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

If you have access to this, then your formula would just be:
Excel Formula:
=MID(FORMULATEXT(C14),23,5)
 
Upvote 0
Solution
By default, formulas run against the value in the cells, not the text of the formula.
However, there is a FORMULATEXT function that will allow you to do this, provided that you are using a new enough version of Excel (see here: FORMULATEXT function)

I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

If you have access to this, then your formula would just be:
Excel Formula:
=MID(FORMULATEXT(C14),23,5)
Thank you so very much. That is exactly what I needed. And thanks for the version feedback.
 
Upvote 0
Thank you so very much. That is exactly what I needed. And thanks for the version feedback.
You are welcome.
Please update your Account details, when you have the chance.
 
Upvote 0

Forum statistics

Threads
1,214,914
Messages
6,122,211
Members
449,074
Latest member
cancansova

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top