if statements

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

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

If statements

resolvedResolved · Low Priority · Version 2007

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?

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

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.


 

Excel tip:

Removing border lines on the keyboard

Highlight your cell(s) that have boreders on them and press CTRL + SHIFT + _, this will then remove the border lines.

View all Excel hints and tips


Server loaded in 0.09 secs.