ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF Statements using previous cell references (https://www.excelbanter.com/excel-worksheet-functions/229770-if-statements-using-previous-cell-references.html)

Tweety

IF Statements using previous cell references
 
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. Valko

IF Statements using previous cell references
 
=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)


--
Biff
Microsoft Excel MVP


"Tweety" wrote in message
...
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....





All times are GMT +1. The time now is 02:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com