Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

if statements

ResolvedVersion 2007

Tracey has attended:
Excel Advanced course
Excel VBA Intro Intermediate course

IF statements

How can I do more with IF statements eg not IF cell A1 = cell B1 but IF B1 contains A1, or starts with A1?

RE: IF statements

Hello Tracey
Thank you for your question

Try the following formula where you want to check if a cell contains some text:

=IF(ISNUMBER(SEARCH("*dog*",A1)),"dog","")

In this example, if the A1 field contains 'dog' anywhere in the cell then 'dog' will be the result of the formula cell. You can change the second dog in the formula to read 'true' or whatever you want.

If you want to see if the cell starts with 'dog' then in a seperate column (for example column B) use the following formula:

=LEFT(A1,3)

This will return the first three letters of the start of the word. In another colun you can use the following formula:

=IF(B1="dog",TRUE,FALSE)

Dont forget that you can hide some of these columns if you dont want them to be seen. The best way to learn more about formulas and IF statements is the take each problem as it comes and research the formula on the internet as many people have often asked the same question before.

If this resolves your question, please mark it as resolved. If not, please reply with more information.

Kind regards
Cress

Wed 25 Feb 2009: Automatically marked as resolved.

Excel tip:

Paste with Live Preview in Excel 2010

Did you know you can preview what you are about to paste? Here's how to do it.

Copy what you are about to paste
Position the cursor where you want to paste
Right click to display the shortcut menu
Place the cursor over the Paste Options and this will give you a preview of the what you are about to paste.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.