if statements
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel Training and help » IF statements

IF statements

resolvedResolved · Medium Priority · Version 2007

replyReply Wed 18 Feb 2009, 17:01Delegate Tracey said...

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?

For upcoming training course dates see: Pricing & availability

replyReply Thu 19 Feb 2009, 10:43Trainer Cress said...

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.

 

Please browse our web site to find out more about
visual+basic+for+excel+courses+london and other Microsoft training courses.

Excel tip:

Autonumber in Excel

To create an autonumber field, can use the Offset() function.

In cell A1, enter the number 1.
Then in cell A2, enter this formula:

=OFFSET(A2,-1,0)+1

Then copy the formula from cell A2, down as far as you need.

See also: Autonumber in Excel forum post.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard