Solved

Need to replace text to formulas

Posted on 2016-09-15
6
60 Views
Last Modified: 2016-09-16
I have cells with 'counta(Ink Annotations!B5:b1000) and need to do a find and replace to end up with:
=counta(Ink Annotations!B5:b1000)
0
Comment
Question by:Alex972
6 Comments
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 41800595
hit ctrl+h

in the first box:
counta

in the second box
=counta

replace all.
0
 
LVL 29

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41800597
Press Ctrl+H to open Find and Replace Window, in Find Waht box type ' and in Replace with box type = and click on Replace All.
0
 
LVL 1

Author Comment

by:Alex972
ID: 41800615
Thanks
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 29

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41800620
You're welcome Alex!
0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 41801155
Find and Replace annoyingly does not work when replacing an apostrophe at the beginning of a cell because Excel does not recognise it as being content of the cell.

To prove it, use =LEFT(A1,1) where A1 contains the text and the result will be c.

Likewise replacing counta with =counta does not work. You end up with '=counta
0
 
LVL 32

Accepted Solution

by:
Rob Henson earned 500 total points
ID: 41801202
I found this question previously answered:

https://www.experts-exchange.com/questions/25194554/convert-text-formula-to-its-mathematical-result.html

This uses a User Defined Function to evaluate the contents of a cell that look like a formula/equation.

The text of the UDF is:
Public Function EvaluateEquation(ByVal Equation As String) As Double
    EvaluateEquation = Evaluate(Equation)
End Function

Open in new window

You then use it in your worksheet like a formula:

=EvaluateEquation(A1)  where A1 contains the formula text.

However, in your example, the sheet name has a space in it and the correct syntax of formulas on sheet names with spaces needs a single quote at each end of the sheet name. To do this use:

=EvaluateEquation(SUBSTITUTE(SUBSTITUTE(A1,"(","('",1),"!","'!"))

This will replace the first instance of ( with (' and all instances of ! with '!

Thanks
Rob H
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now