Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
seve
 
Posts: n/a
Default Varying left criteria based on 1st Letter....If Function?

Hello,

I am using Pivot Tables for Inventory purposes.

I'd like to use a shortened description based on the first letter of
the description.

Can I use an If Statement?


Such as if 1st letter of Description is M - use 1st Left 5 characters,
if 1st letter of description is L - use 1st Left 8 characters?


Steve

  #2   Report Post  
Posted to microsoft.public.excel.misc
Ken Wright
 
Posts: n/a
Default Varying left criteria based on 1st Letter....If Function?

=IF(LEFT(A1)="M",LEFT(A1,5),IF(LEFT(A1)="L",LEFT(A 1,8),"If not then display
this"))

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------*------------------------------*----------------
It's easier to beg forgiveness than ask permission :-)
------------------------------*------------------------------*----------------



"seve" wrote in message
oups.com...
Hello,

I am using Pivot Tables for Inventory purposes.

I'd like to use a shortened description based on the first letter of
the description.

Can I use an If Statement?


Such as if 1st letter of Description is M - use 1st Left 5 characters,
if 1st letter of description is L - use 1st Left 8 characters?


Steve



  #3   Report Post  
Posted to microsoft.public.excel.misc
Ken Wright
 
Posts: n/a
Default Varying left criteria based on 1st Letter....If Function?

Or perhaps more scalable:-

=LEFT(A1,VLOOKUP(LEFT(A1),{"L",8;"M",5},2,0))

which can be expanded quite easily to add more letters:-

=LEFT(A1,VLOOKUP(LEFT(A1),{"A",4;"B",5;"C",6;"L",8 ;"M",5;"X",3;"Y",4;"Z",5},2,0))

Regards
Ken................


"Ken Wright" wrote in message
...
=IF(LEFT(A1)="M",LEFT(A1,5),IF(LEFT(A1)="L",LEFT(A 1,8),"If not then
display this"))

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------*------------------------------*----------------
It's easier to beg forgiveness than ask permission :-)
------------------------------*------------------------------*----------------



"seve" wrote in message
oups.com...
Hello,

I am using Pivot Tables for Inventory purposes.

I'd like to use a shortened description based on the first letter of
the description.

Can I use an If Statement?


Such as if 1st letter of Description is M - use 1st Left 5 characters,
if 1st letter of description is L - use 1st Left 8 characters?


Steve





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
Locate a cell, based on a criteria, then use the 'Cell' command... cdavidson Excel Discussion (Misc queries) 1 November 17th 05 06:30 PM
Returning Results Based on Two Criteria [email protected] Excel Worksheet Functions 7 October 23rd 05 02:53 PM
How can I reference a cell as the criteria in a count if function. RobA Excel Discussion (Misc queries) 1 August 17th 05 06:41 PM
Help with function to add percentage to cell based on checkbox. foxgguy2005 Excel Worksheet Functions 3 June 1st 05 05:52 AM
Can I use a cell reference in the criteria for the sumif function. Number Cruncher Excel Worksheet Functions 2 November 4th 04 07:52 PM


All times are GMT +1. The time now is 06:38 AM.

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

About Us

"It's about Microsoft Excel"