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 · Low Priority · Version 2007

replyReply Wed 1 Jun 2011, 16:23Delegate Maaike said...

Maaike has attended:
Excel Advanced course

If statements

I would like to create a form in which special characters such as % and £ can be detected and replaced with 'percent' and 'pound', how is this possible?

For upcoming training course dates see: Pricing & availability

replyReply Thu 2 Jun 2011, 12:01Delegate Chris said...

RE: if statements

Type something like "5%" in A1, and then the following in any cell (e.g. A2):

=IF(ISERROR(FIND("%",TEXT(A1,"0%"))),TEXT(A1,"0%"),SUBSTITUTE(TEXT(A1,"0%"),"%"," percent"))

You should be able to adapt it from there.

Hope this helps! :)

Chris Martin
Senior Analyst
Research Partnership

replyReply Thu 2 Jun 2011, 13:03Trainer Anthony said...

RE: if statements

Hi Maaike, thanks for your query. That's going to be difficult to achieve within the same control on a form, I'm afraid - particularly if the form you are building is on the worksheet itself. Essentially you're allowing the user to change a cell, but including code in that cell to parse the incoming text and format it accordingly. You could do this with a mixture of IF and RIGHT functions, but only to send the end result into a different cell.

Alternatively you could code the whole thing, but that's a conversation for our VBA course!

Hope this helps,

Anthony

Thu 9 Jun 2011: Automatically marked as resolved.

 

Please browse our web site to find out more about
excel training companies london and other Microsoft training courses.

Excel tip:

New Normal Worksheet

Do you want all your worksheets to confirm to a certain look? Then change the Defaults!!!
1. Press Shift+F11 to create a new worksheet
2. Press Ctrl+A to select (higlight) all cells, Press Ctrl+1, make any formatting changes then click OK.
3. Press F12 (Function 12 key) click in the Save As Type, drop down, then select Template (*.xlt)
4. Click in the Save in drop-down, then find the folder; c:_program files_microsoft office_office_start. (For the underscores shown use backslash)
Name your templete sheet.xlt, then press Enter.
Sheet.xlt is used when you insert a new worksheet (Shift+F11)

Note: These changes are permanent changes on your PC.

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