IF Statements using previous cell references

  • Thread starter Thread starter Tweety
  • Start date Start date
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....
 
=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)
 
Back
Top