Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jeremy Turner
 
Posts: n/a
Default Trimming cell contents?

Hi

I have a column of cells each containing a 4 digit number. Is there any way
I can trim the left digit dependant upon certain conditions.

If the left digit of each 4 digit number equals either "1" or "2" I want to
trim this away. If the original 4 digit number ends in anything other than
"1" or "2" I want to leave the original 4 digit number unaltered.

For example:

1231 would become 123
1232 would become 123
1234 would stay as 1234

Any help on this is really appreciated.

Many thanks in advance

Jem


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Trimming cell contents?

See response in excel.misc

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Jeremy Turner" wrote in message
...
Hi

I have a column of cells each containing a 4 digit number. Is there any

way
I can trim the left digit dependant upon certain conditions.

If the left digit of each 4 digit number equals either "1" or "2" I want

to
trim this away. If the original 4 digit number ends in anything other

than
"1" or "2" I want to leave the original 4 digit number unaltered.

For example:

1231 would become 123
1232 would become 123
1234 would stay as 1234

Any help on this is really appreciated.

Many thanks in advance

Jem




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mallycat
 
Posts: n/a
Default Trimming cell contents?


I'm sure I have answered this somewhere else

=IF(OR(LEFT(E11,1)="1",LEFT(E11,1)="2"),RIGHT(E11, 3),E11)

Matt


--
Mallycat
------------------------------------------------------------------------
Mallycat's Profile: http://www.excelforum.com/member.php...o&userid=35514
View this thread: http://www.excelforum.com/showthread...hreadid=553173

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jeremy Turner
 
Posts: n/a
Default Trimming cell contents?

Thanks so much for the prompt response. I must apologise for crossposting
to the other Excel groups but I have to confess that I wasn't sure which
group I should post in.

Thanks again

Jem


"Jeremy Turner" wrote in message
...
Hi

I have a column of cells each containing a 4 digit number. Is there any
way I can trim the left digit dependant upon certain conditions.

If the left digit of each 4 digit number equals either "1" or "2" I want
to trim this away. If the original 4 digit number ends in anything other
than "1" or "2" I want to leave the original 4 digit number unaltered.

For example:

1231 would become 123
1232 would become 123
1234 would stay as 1234

Any help on this is really appreciated.

Many thanks in advance

Jem



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Trimming cell contents?

Jeremy,

If you want to hit many groups, do them all in the same message. When we
read them they then get read in all groups.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Jeremy Turner" wrote in message
...
Thanks so much for the prompt response. I must apologise for crossposting
to the other Excel groups but I have to confess that I wasn't sure which
group I should post in.

Thanks again

Jem


"Jeremy Turner" wrote in message
...
Hi

I have a column of cells each containing a 4 digit number. Is there any
way I can trim the left digit dependant upon certain conditions.

If the left digit of each 4 digit number equals either "1" or "2" I want
to trim this away. If the original 4 digit number ends in anything

other
than "1" or "2" I want to leave the original 4 digit number unaltered.

For example:

1231 would become 123
1232 would become 123
1234 would stay as 1234

Any help on this is really appreciated.

Many thanks in advance

Jem





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with this conditional IF statement C-Dawg Excel Discussion (Misc queries) 3 May 15th 06 06:01 PM
separating numbers and letters from alphanumeric cell contents PH Excel Worksheet Functions 10 September 3rd 05 12:15 PM
Conversion of Cell Contents into a Functional Worksheet name ? GMJT Excel Worksheet Functions 1 August 21st 05 04:59 PM
Function syntax to compare cell contents ES Excel Worksheet Functions 2 May 18th 05 03:53 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 06:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"