LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Fredrik Wahlgren
 
Posts: n/a
Default


"Aladin Akyurek" wrote in message
...
Fredrik Wahlgren wrote:
"Aladin Akyurek" wrote in message
...

=ABS(INDIRECT(ADDRESS(COUNTIF(E1:E10,"0"),5)) )

returns

0

when:

E1: 1
E2: 3
E3: 3
E4: 0
E5: 3.4

E6 to E10 are empty.

Is the result of 0 this expensive formula returns correct?



The best I can think of is a UDF. This one should work. It just loops

over
the passed range and puts the value of each cell in the range as long as

it
is <0.

Public Function test(ByVal r As Range) As Variant
On Error Resume Next
Dim Cell As Range
Dim v As Variant

For Each Cell In r
If 0 < Cell.Value Then
v = Cell.Value
End If
Next

If vbDouble = VarType(v) Then
test = Abs(v)
Else
test = 0
End If
End Function

/Fredrik



I did not try the UDF you suggest. Does it compute something different
from the formula Domenic suggested in his reply or its equivalent:

=LOOKUP(2,1/(E1:E100),E1:E10)


I haven't tested that. If it works OK, use his suggestion. If nothing else,
it's easier to use.

/Fredrik


 
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
How do I sort by row instead of by column? PercivalMound Excel Worksheet Functions 7 August 28th 06 10:41 PM
up to 7 functions? ALex Excel Worksheet Functions 10 April 12th 05 06:42 PM
How do I reference every "n" cell in a column in Excel? Alma Excel Worksheet Functions 2 March 22nd 05 06:19 PM
Formula for a column comicfly Excel Discussion (Misc queries) 2 March 11th 05 12:16 PM
Copying the contents of a column into a chart Richard Excel Worksheet Functions 1 November 16th 04 02:39 PM


All times are GMT +1. The time now is 01:01 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"