extracting text from a cell formula

N

none

Hi All,

I would like to pull out some text from a cell formula, can anyone give me
an idea how to do it if it is possible. We have a pop quiz and the answers
are given like follows:
=IF(C8="Leo Sayer","Correct"," ")
I would like to be able to list all the answers

Cheers,

Ingrid
 
B

Bob Phillips

Ingrid,

Put the answers in a column far to the right, say BH, and hide the column
Then use

=IF(C8=BH8, "Correct","")

Not foolproof, but anyone who needs to cheat shouldn't be playing.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
B

Bernard Liengme

Hi Ingrid,
Let's say the IF formula is in G8
1)Use VBA editor to Insert a module and add this function
Function showform(x As Range)
showform = x.Formula
End Function
2) In H8 enter =SHOWFORM(G8) and the formula is displayed
3) In I8 enter =MID(H8,FIND("""",H8)+1,FIND(",",H8)-2-FIND("""",H8))
This will extract the first piece of text in the formula

Hope I have not screwed up some teacher's quiz!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top