#1   Report Post  
danlinksman
 
Posts: n/a
Default formula Question

If cells 1 thru 7 are each a zero ( 0 ) and cell 8 is a Z how do I write a
formula that returns Z if Zero is not present in every one of the 8 cells.

Example

0 0 0 0 0 0 0 0 Z = Z

0 0 0 0 0 0 0 0 0 = 0

A 0 0 0 0 0 0 0 0 =A
  #2   Report Post  
galimi
 
Posts: n/a
Default

Use the following function:

Function nozero(rng)
Application.Volatile True
For Each cl In rng
If cl.Value < 0 Then
StrBack = StrBack & cl.Value
End If
Next
nozero = StrBack
End Function

http://HelpExcel.com

"danlinksman" wrote:

If cells 1 thru 7 are each a zero ( 0 ) and cell 8 is a Z how do I write a
formula that returns Z if Zero is not present in every one of the 8 cells.

Example

0 0 0 0 0 0 0 0 Z = Z

0 0 0 0 0 0 0 0 0 = 0

A 0 0 0 0 0 0 0 0 =A

  #3   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Mon, 24 Jan 2005 17:11:03 -0800, "danlinksman"
wrote:

If cells 1 thru 7 are each a zero ( 0 ) and cell 8 is a Z how do I write a
formula that returns Z if Zero is not present in every one of the 8 cells.

Example

0 0 0 0 0 0 0 0 Z = Z

0 0 0 0 0 0 0 0 0 = 0

A 0 0 0 0 0 0 0 0 =A


Your question is unclear.

First of all, in your first example, cells 1 thru 7 are 0's, but you are
showing "Z" as the result.

Also, in your third example, even though the first value is "A", you are
returning an "A" and not a "Z".

If your question is really "If I have a series of 0's and only 1 letter, return
0 if there are only 0's but return the letter if there is one letter; and if
there can be only a single letter with all other entries being zero's, then the
answer to that question is the *array-formula*:

=CHAR(MAX(CODE(rng)))

where rng is the cell reference for the range in which the entries are made
(e.g. A1:I1).

To enter an *array-formula*, after typing in the formula, hold down
<ctrl<shift while hitting <enter. XL will place braces {...} around the
formula.


--ron
  #4   Report Post  
danlinksman
 
Posts: n/a
Default

Perfect....

Thanks it worked!

"danlinksman" wrote:

If cells 1 thru 7 are each a zero ( 0 ) and cell 8 is a Z how do I write a
formula that returns Z if Zero is not present in every one of the 8 cells.

Example

0 0 0 0 0 0 0 0 Z = Z

0 0 0 0 0 0 0 0 0 = 0

A 0 0 0 0 0 0 0 0 =A

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
Formula Question Qaspec Excel Discussion (Misc queries) 2 January 10th 05 03:59 AM
Formula Question IF/Lookup???? Hague2 Excel Worksheet Functions 2 January 7th 05 06:30 PM
Lookup/Index formula question. Barbara Excel Worksheet Functions 2 December 7th 04 04:45 PM
Parsing Data w/ a Formula (another question) carl Excel Worksheet Functions 2 December 3rd 04 06:51 PM
SUM array formula question Dan Excel Worksheet Functions 6 November 8th 04 05:49 AM


All times are GMT +1. The time now is 07:57 AM.

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"