Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have a field with varying number of characters, I need function that
returns a value based on the number of characters in field. ie if field x <2 characters = 1 2 characters = 2 Thanks |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Use the LEN function. Look it up in Excel help.
-- David Biddulph "Perplexed" wrote in message ... I have a field with varying number of characters, I need function that returns a value based on the number of characters in field. ie if field x <2 characters = 1 2 characters = 2 Thanks |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
How about exactly 2 chars?
=MAX(IF(LEN(A1)=2,2),1) returns 1 if <2 otherwise returns 2 Gord Dibben MS Excel MVP On Wed, 10 Dec 2008 11:47:00 -0800, Perplexed wrote: I have a field with varying number of characters, I need function that returns a value based on the number of characters in field. ie if field x <2 characters = 1 2 characters = 2 Thanks |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Here is one more formula for you to consider...
=1+(LEN(A1)=2) You didn't define what should happen if there are exact two characters in the cell, so I treated it the same as when there are more than two characters in the cell. If that is wrong, just change the = to by itself. -- Rick (MVP - Excel) "Perplexed" wrote in message ... I have a field with varying number of characters, I need function that returns a value based on the number of characters in field. ie if field x <2 characters = 1 2 characters = 2 Thanks |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi
=MIN(LEN(A4),2) However, since you didn't tell us what to do if len=2, I choose to treat it as =2 -- If this helps, please click the Yes button Cheers, Shane Devenshire "Perplexed" wrote: I have a field with varying number of characters, I need function that returns a value based on the number of characters in field. ie if field x <2 characters = 1 2 characters = 2 Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
LIMIT THE NUMBER OF CHARACTERS ENTERED IN A FIELD | Excel Worksheet Functions | |||
return a number from a cell based on the lastest date | Excel Worksheet Functions | |||
Deleting rows based on number of characters | Excel Discussion (Misc queries) | |||
Split field based on number of characters and space | Excel Worksheet Functions | |||
How to return # characters based on 2nd instance of value | Excel Worksheet Functions |