IF Statements using previous cell references

T

Tweety

hi

I'm trying to create an if statement that allows me to bring across data
from another worksheet within the same book.

However, when i create the 'true' statement and try to add the cell
reference from the previous worksheet the statement takes the worksheet &
cell name as the answer... so

so when in worksheet 2
=IF("worksheetA'!L3="Yes","'WorksheetA'!C3'","0")

then the 'True' answer goes into the cell as

'WorksheetA!C3'
Whereas i actually want what the 'text' is in the cell in that worksheet as
the answer.

are you able to have a cell as an answer to an 'IF' statement or will that
just not work?

Hope that makes sense....
 
T

T. Valko

=IF("worksheetA'!L3="Yes","'WorksheetA'!C3'","0")

You have too many quotes. Try it like this:

=IF(WorksheetA!L3="Yes",WorksheetA!C3,0)

General tip about quotes: quote TEXT constants like the "Yes" in the
formula. Do not quote numbers like the 0 in the formula.

If the sheet name contains spaces or numbers then you need to single quote
the sheet name:

=IF('Work sheetA'!L3="Yes",'Work sheetA'!C3,0)
 

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