ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If function (https://www.excelbanter.com/excel-worksheet-functions/17797-if-function.html)

Veronica

If function
 
In cell A1 I have: action, fiction, drama
If I have the word "drama" in cell A1, I want to enter the word "drama" in
cell A2.
How can I do this? I tried to use the if function but it doesn't work
because the words "action" and "fiction" are on the cell.


Steve R

=if(A1="drama","drama","")

"Veronica" wrote in message
...
In cell A1 I have: action, fiction, drama
If I have the word "drama" in cell A1, I want to enter the word "drama" in
cell A2.
How can I do this? I tried to use the if function but it doesn't work
because the words "action" and "fiction" are on the cell.




Roger H.

Hello Veronica. As a follow up to the previous answer, you might need to put
an asterisk in front of the first argument to the if finction to account for
the preceeding text : =IF(A1=*"drama","drama",""). This lets the function
know that there's other text within the cell, that comes BEFORE the text
"drama".
"Veronica" wrote in message
...
In cell A1 I have: action, fiction, drama
If I have the word "drama" in cell A1, I want to enter the word "drama" in
cell A2.
How can I do this? I tried to use the if function but it doesn't work
because the words "action" and "fiction" are on the cell.




Roger H.

Oooops......put the asterisk WITHIN the quotation marks--- sorry.
"Roger H." wrote in message
...
Hello Veronica. As a follow up to the previous answer, you might need to
put an asterisk in front of the first argument to the if finction to
account for the preceeding text : =IF(A1=*"drama","drama",""). This lets
the function know that there's other text within the cell, that comes
BEFORE the text "drama".
"Veronica" wrote in message
...
In cell A1 I have: action, fiction, drama
If I have the word "drama" in cell A1, I want to enter the word "drama"
in
cell A2.
How can I do this? I tried to use the if function but it doesn't work
because the words "action" and "fiction" are on the cell.







All times are GMT +1. The time now is 08:13 PM.

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