PC Review


Reply
Thread Tools Rate Thread

Can Formulas use a certain Digit, like the 1st or 2nd Digit, in all Cells in a Range?

 
 
Arnold
Guest
Posts: n/a
 
      2nd Aug 2007
Hi All,
Is there a way for formulas to use only the first numeric digit in all
cells, for example, to the right of col X? And likewise, is there a
way for formulas to work with only the 2nd or the 3rd numeric digits
in cells? Specifically, each of the cols past X contain a 3 digit
code. The digits may only = 0, 1, 2, 3, or 4. The cells may also be
blank or null. Each of digits in the cols. would need to be included
into the formulas. And, the range of cells (cols) will grow daily.
Any insight/example would be greatly appreciated.
Thanks very much,
Arnold

 
Reply With Quote
 
 
 
 
Ron Rosenfeld
Guest
Posts: n/a
 
      2nd Aug 2007
On Wed, 01 Aug 2007 17:12:46 -0700, Arnold <(E-Mail Removed)> wrote:

>Hi All,
>Is there a way for formulas to use only the first numeric digit in all
>cells, for example, to the right of col X? And likewise, is there a
>way for formulas to work with only the 2nd or the 3rd numeric digits
>in cells? Specifically, each of the cols past X contain a 3 digit
>code. The digits may only = 0, 1, 2, 3, or 4. The cells may also be
>blank or null. Each of digits in the cols. would need to be included
>into the formulas. And, the range of cells (cols) will grow daily.
>Any insight/example would be greatly appreciated.
>Thanks very much,
>Arnold


What you describe can be done. You could use either TEXT functions, or perhaps
INT and MOD functions.

For example, the middle digit of a three digit number can be obtained with the
formula: =MID(TEXT(Y1,"000"),2,1).

12 --> 1 (The three digit number, in this instance, would be 012).


--ron
 
Reply With Quote
 
Arnold
Guest
Posts: n/a
 
      2nd Aug 2007
Thanks for responding Ron,

I searched the groups for what you recommended, reviewing a couple of
similar threads, including one that you contributed to: Use of Like
to extract data, and Detecting a number versus text. However, I
cannot see how to have formulas directly use these separate left-mid-
right values formatted as TEXT.

For instance, if the following values are in these cols:

AZ BA BB BC ...
201 323 434 <null>

how could I write these formulas in cols such as:

L
=sum 'the 1st digits in all cells' (AZ09:IV09)

M
=sum 'the 2nd digits in all cells' (AZ09:IV09)

N
=sum 'the 3rd digits in all cells' (AZ09:IV09)


as well as other general formulas requiring numeric values:

F
=count(AZ09:IV09)

G
=countif(AZ09:IV09,"0")

H
=countif(AZ09:IV09,">0")


Thanks once again

 
Reply With Quote
 
Ron Rosenfeld
Guest
Posts: n/a
 
      2nd Aug 2007
On Thu, 02 Aug 2007 07:43:59 -0700, Arnold <(E-Mail Removed)> wrote:

>Thanks for responding Ron,
>
>I searched the groups for what you recommended, reviewing a couple of
>similar threads, including one that you contributed to: Use of Like
>to extract data, and Detecting a number versus text. However, I
>cannot see how to have formulas directly use these separate left-mid-
>right values formatted as TEXT.


Being more specific in your requirements, as you are below, will bring a more
applicable answer, usually.

>
>For instance, if the following values are in these cols:
>
>AZ BA BB BC ...
>201 323 434 <null>
>
>how could I write these formulas in cols such as:
>
>L
>=sum 'the 1st digits in all cells' (AZ09:IV09)
>


=SUMPRODUCT(--LEFT(TEXT(AZ09:IV09,"000"),1))

>M
>=sum 'the 2nd digits in all cells' (AZ09:IV09)


=SUMPRODUCT(--MID(TEXT(AZ09:IV09,"000"),2,1))
>
>N
>=sum 'the 3rd digits in all cells' (AZ09:IV09)
>


=SUMPRODUCT(--MID(TEXT(AZ09:IV09,"000"),3,1))

>
>as well as other general formulas requiring numeric values:
>


It is not clear to me what you want to do with the examples below. But perhaps
you can reason from the above solutions.


>F
>=count(AZ09:IV09)
>
>G
>=countif(AZ09:IV09,"0")
>
>H
>=countif(AZ09:IV09,">0")
>
>
>Thanks once again


--ron
 
Reply With Quote
 
Arnold
Guest
Posts: n/a
 
      2nd Aug 2007
THANKS RON!!

 
Reply With Quote
 
Ron Rosenfeld
Guest
Posts: n/a
 
      2nd Aug 2007
On Thu, 02 Aug 2007 09:22:31 -0700, Arnold <(E-Mail Removed)> wrote:

>THANKS RON!!


You're welcome. Glad to help.
--ron
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Color a single digit in a mult-digit number cell =?Utf-8?B?UGh5bGxpcw==?= Microsoft Excel Misc 6 17th Nov 2005 12:46 AM
Excel: let me a color a single digit in a multi-digit cell =?Utf-8?B?UGh5bGxpcw==?= Microsoft Frontpage 6 13th Nov 2005 11:13 PM
When we enter a 16 digit number (credit card) the last digit chan. =?Utf-8?B?Y2VraW5n?= Microsoft Excel Misc 5 8th Dec 2004 11:45 PM
Sorting of mixed zip codes (5 digit and 9 digit) in ascending order =?Utf-8?B?Tk1fRnJlbmNobWFu?= Microsoft Excel Worksheet Functions 3 26th Jan 2004 09:08 PM
Change 2 digit suffix in 14 digit number in a column of numbers. Brad H. Microsoft Excel Worksheet Functions 1 4th Sep 2003 04:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:21 PM.