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

if statements

ResolvedVersion 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:

Hide separate columns in Excel 2010

If you want to hide columns not adjacent to each other for example, Columns A, C and E then:-

1) Click on the fist column to be hidden i.e. A

2) Press and hold down the CTRL key

3) While holding the CTRL key, left click on the rest of the columns you want to hide i.e. C and E

4) Right click and choose Hide

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.