Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Biff
 
Posts: n/a
Default Explain return of #N/A

Hi Folks!

Trying to extract uniques from a list and make it dynamic. It works as long
as there are at least 2 entries in the list. If there is only 1 entry in the
list the formula errors but i don't understand why.

The formula without the error trap: (array)

=INDEX(List,MATCH(0,COUNTIF(A$1:A1,List),0))

List is a dynamic range name.

With only a single entry in List and A1 being empty, this is how the formula
evaluates:

=INDEX({1},MATCH(0,0,0))

Match returns #N/A when it should return 1 since 0 matches 0 and it's in the
first position of the lookup_array and the result of the entire formula
shoud be 1 since 1 is in the first position of the Index array.

Can anyone explain why this is not working?

Thanks

Biff





  #2   Report Post  
Matt Lunn
 
Posts: n/a
Default

Biff,

Not sure why that isn't working but is it necessary to use this method?

Could you use DataFilterAdvanced Filter?

If your method is necessary please post details of the list dynamic formula
and the type of data it contains.

Thanks,
Matt

"Biff" wrote:

Hi Folks!

Trying to extract uniques from a list and make it dynamic. It works as long
as there are at least 2 entries in the list. If there is only 1 entry in the
list the formula errors but i don't understand why.

The formula without the error trap: (array)

=INDEX(List,MATCH(0,COUNTIF(A$1:A1,List),0))

List is a dynamic range name.

With only a single entry in List and A1 being empty, this is how the formula
evaluates:

=INDEX({1},MATCH(0,0,0))

Match returns #N/A when it should return 1 since 0 matches 0 and it's in the
first position of the lookup_array and the result of the entire formula
shoud be 1 since 1 is in the first position of the Index array.

Can anyone explain why this is not working?

Thanks

Biff






  #3   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Filters aren't dynamic!

There's nothing wrong with the named range formula:

=OFFSET(Sheet1!$A$1,,,COUNT(Sheet1!$A:$A))

The data is numeric.

Biff

"Matt Lunn" wrote in message
...
Biff,

Not sure why that isn't working but is it necessary to use this method?

Could you use DataFilterAdvanced Filter?

If your method is necessary please post details of the list dynamic
formula
and the type of data it contains.

Thanks,
Matt

"Biff" wrote:

Hi Folks!

Trying to extract uniques from a list and make it dynamic. It works as
long
as there are at least 2 entries in the list. If there is only 1 entry in
the
list the formula errors but i don't understand why.

The formula without the error trap: (array)

=INDEX(List,MATCH(0,COUNTIF(A$1:A1,List),0))

List is a dynamic range name.

With only a single entry in List and A1 being empty, this is how the
formula
evaluates:

=INDEX({1},MATCH(0,0,0))

Match returns #N/A when it should return 1 since 0 matches 0 and it's in
the
first position of the lookup_array and the result of the entire formula
shoud be 1 since 1 is in the first position of the Index array.

Can anyone explain why this is not working?

Thanks

Biff








  #4   Report Post  
Matt Lunn
 
Posts: n/a
Default

Biff,

Your named range formula may be wrong. At the moment it will start from A1
but create a formula with 0 rows and (count of Column A) amount of columns.
This may be why this is evaluating to 0 in your formula?

Try

=OFFSET(Sheet1!$A$1,,COUNT(Sheet1!$A:$A),1)

Thanks,
Matt

"Biff" wrote:

Hi!

Filters aren't dynamic!

There's nothing wrong with the named range formula:

=OFFSET(Sheet1!$A$1,,,COUNT(Sheet1!$A:$A))

The data is numeric.

Biff

"Matt Lunn" wrote in message
...
Biff,

Not sure why that isn't working but is it necessary to use this method?

Could you use DataFilterAdvanced Filter?

If your method is necessary please post details of the list dynamic
formula
and the type of data it contains.

Thanks,
Matt

"Biff" wrote:

Hi Folks!

Trying to extract uniques from a list and make it dynamic. It works as
long
as there are at least 2 entries in the list. If there is only 1 entry in
the
list the formula errors but i don't understand why.

The formula without the error trap: (array)

=INDEX(List,MATCH(0,COUNTIF(A$1:A1,List),0))

List is a dynamic range name.

With only a single entry in List and A1 being empty, this is how the
formula
evaluates:

=INDEX({1},MATCH(0,0,0))

Match returns #N/A when it should return 1 since 0 matches 0 and it's in
the
first position of the lookup_array and the result of the entire formula
shoud be 1 since 1 is in the first position of the Index array.

Can anyone explain why this is not working?

Thanks

Biff









  #5   Report Post  
Biff
 
Posts: n/a
Default

Hi!

The point of the formula is to not offset A1 by any rows. All I want it to
do is return an array of values and as I have it written that's what it
does. A1 is simply the start of the range. The end of the range depends upon
the COUNT of column A. If there's nothing in the range it doesn't matter
because there's nothing to extract!

Just to reduce any confusion, the extraction formula is on a different sheet
so the reference to A1 in that formula is not the same reference to A1 in
the range name formula.

Biff

"Matt Lunn" wrote in message
...
Biff,

Your named range formula may be wrong. At the moment it will start from A1
but create a formula with 0 rows and (count of Column A) amount of
columns.
This may be why this is evaluating to 0 in your formula?

Try

=OFFSET(Sheet1!$A$1,,COUNT(Sheet1!$A:$A),1)

Thanks,
Matt

"Biff" wrote:

Hi!

Filters aren't dynamic!

There's nothing wrong with the named range formula:

=OFFSET(Sheet1!$A$1,,,COUNT(Sheet1!$A:$A))

The data is numeric.

Biff

"Matt Lunn" wrote in message
...
Biff,

Not sure why that isn't working but is it necessary to use this method?

Could you use DataFilterAdvanced Filter?

If your method is necessary please post details of the list dynamic
formula
and the type of data it contains.

Thanks,
Matt

"Biff" wrote:

Hi Folks!

Trying to extract uniques from a list and make it dynamic. It works as
long
as there are at least 2 entries in the list. If there is only 1 entry
in
the
list the formula errors but i don't understand why.

The formula without the error trap: (array)

=INDEX(List,MATCH(0,COUNTIF(A$1:A1,List),0))

List is a dynamic range name.

With only a single entry in List and A1 being empty, this is how the
formula
evaluates:

=INDEX({1},MATCH(0,0,0))

Match returns #N/A when it should return 1 since 0 matches 0 and it's
in
the
first position of the lookup_array and the result of the entire
formula
shoud be 1 since 1 is in the first position of the Index array.

Can anyone explain why this is not working?

Thanks

Biff













  #6   Report Post  
Biff
 
Posts: n/a
Default

Found a work around but would still like to know why this didn't work!

I put a blank, ="" , into cell A1 of the named range List. So the actual
numeric entries will now have to start in cell A2.

Also, since "" is a text value changed the named range formula using COUNTA
instead of COUNT.

Biff

"Biff" wrote in message
...
Hi!

The point of the formula is to not offset A1 by any rows. All I want it to
do is return an array of values and as I have it written that's what it
does. A1 is simply the start of the range. The end of the range depends
upon the COUNT of column A. If there's nothing in the range it doesn't
matter because there's nothing to extract!

Just to reduce any confusion, the extraction formula is on a different
sheet so the reference to A1 in that formula is not the same reference to
A1 in the range name formula.

Biff

"Matt Lunn" wrote in message
...
Biff,

Your named range formula may be wrong. At the moment it will start from
A1
but create a formula with 0 rows and (count of Column A) amount of
columns.
This may be why this is evaluating to 0 in your formula?

Try

=OFFSET(Sheet1!$A$1,,COUNT(Sheet1!$A:$A),1)

Thanks,
Matt

"Biff" wrote:

Hi!

Filters aren't dynamic!

There's nothing wrong with the named range formula:

=OFFSET(Sheet1!$A$1,,,COUNT(Sheet1!$A:$A))

The data is numeric.

Biff

"Matt Lunn" wrote in message
...
Biff,

Not sure why that isn't working but is it necessary to use this
method?

Could you use DataFilterAdvanced Filter?

If your method is necessary please post details of the list dynamic
formula
and the type of data it contains.

Thanks,
Matt

"Biff" wrote:

Hi Folks!

Trying to extract uniques from a list and make it dynamic. It works
as
long
as there are at least 2 entries in the list. If there is only 1 entry
in
the
list the formula errors but i don't understand why.

The formula without the error trap: (array)

=INDEX(List,MATCH(0,COUNTIF(A$1:A1,List),0))

List is a dynamic range name.

With only a single entry in List and A1 being empty, this is how the
formula
evaluates:

=INDEX({1},MATCH(0,0,0))

Match returns #N/A when it should return 1 since 0 matches 0 and it's
in
the
first position of the lookup_array and the result of the entire
formula
shoud be 1 since 1 is in the first position of the Index array.

Can anyone explain why this is not working?

Thanks

Biff













  #7   Report Post  
ScottO
 
Posts: n/a
Default

You may have moved on from this one, but in case it's still eating at your
brain ...
I think it failed because the second argument in =MATCH(0,0,0) is looking
for an array, not a single value.
To test I entered just =MATCH(0,0,0) in a cell and it returned #NA, but then
I entered =MATCH(0,{0},0) in another cell (I manually typed the {}) and it
returned 1.
HTH
Rgds,
ScottO

"Biff" wrote in message
...
| Found a work around but would still like to know why this didn't work!
|
| I put a blank, ="" , into cell A1 of the named range List. So the actual
| numeric entries will now have to start in cell A2.
|
| Also, since "" is a text value changed the named range formula using
COUNTA
| instead of COUNT.
|
| Biff
|
| "Biff" wrote in message
| ...
| Hi!
|
| The point of the formula is to not offset A1 by any rows. All I want it
to
| do is return an array of values and as I have it written that's what it
| does. A1 is simply the start of the range. The end of the range depends
| upon the COUNT of column A. If there's nothing in the range it doesn't
| matter because there's nothing to extract!
|
| Just to reduce any confusion, the extraction formula is on a different
| sheet so the reference to A1 in that formula is not the same reference
to
| A1 in the range name formula.
|
| Biff
|
| "Matt Lunn" wrote in message
| ...
| Biff,
|
| Your named range formula may be wrong. At the moment it will start from
| A1
| but create a formula with 0 rows and (count of Column A) amount of
| columns.
| This may be why this is evaluating to 0 in your formula?
|
| Try
|
| =OFFSET(Sheet1!$A$1,,COUNT(Sheet1!$A:$A),1)
|
| Thanks,
| Matt
|
| "Biff" wrote:
|
| Hi!
|
| Filters aren't dynamic!
|
| There's nothing wrong with the named range formula:
|
| =OFFSET(Sheet1!$A$1,,,COUNT(Sheet1!$A:$A))
|
| The data is numeric.
|
| Biff
|
| "Matt Lunn" wrote in message
| ...
| Biff,
|
| Not sure why that isn't working but is it necessary to use this
| method?
|
| Could you use DataFilterAdvanced Filter?
|
| If your method is necessary please post details of the list dynamic
| formula
| and the type of data it contains.
|
| Thanks,
| Matt
|
| "Biff" wrote:
|
| Hi Folks!
|
| Trying to extract uniques from a list and make it dynamic. It works
| as
| long
| as there are at least 2 entries in the list. If there is only 1
entry
| in
| the
| list the formula errors but i don't understand why.
|
| The formula without the error trap: (array)
|
| =INDEX(List,MATCH(0,COUNTIF(A$1:A1,List),0))
|
| List is a dynamic range name.
|
| With only a single entry in List and A1 being empty, this is how
the
| formula
| evaluates:
|
| =INDEX({1},MATCH(0,0,0))
|
| Match returns #N/A when it should return 1 since 0 matches 0 and
it's
| in
| the
| first position of the lookup_array and the result of the entire
| formula
| shoud be 1 since 1 is in the first position of the Index array.
|
| Can anyone explain why this is not working?
|
| Thanks
|
| Biff
|
|
|
|
|
|
|
|
|
|
|
|
|


  #8   Report Post  
Biff
 
Posts: n/a
Default

in case it's still eating at your brain ...

Yes, it is.

I'm still wanting an explanation, so I haven't moved on!

Hmmm.....

I think you're right. That would explain why it works if there are least 2
entries in the list. This only happens when I try making the whole thing
dynamic. If the data is static it works just fine.

But then that makes me ask why MATCH will accept (work with) a single
element array constant {0}and not the single element array 0 that's
generated by the COUNTIF?

Hmmm....

I do have the work around but with this info maybe I can come up with a
better work around.

Thanks!

Biff

"ScottO" wrote in message
...
You may have moved on from this one, but in case it's still eating at your
brain ...
I think it failed because the second argument in =MATCH(0,0,0) is looking
for an array, not a single value.
To test I entered just =MATCH(0,0,0) in a cell and it returned #NA, but
then
I entered =MATCH(0,{0},0) in another cell (I manually typed the {}) and it
returned 1.
HTH
Rgds,
ScottO

"Biff" wrote in message
...
| Found a work around but would still like to know why this didn't work!
|
| I put a blank, ="" , into cell A1 of the named range List. So the actual
| numeric entries will now have to start in cell A2.
|
| Also, since "" is a text value changed the named range formula using
COUNTA
| instead of COUNT.
|
| Biff
|
| "Biff" wrote in message
| ...
| Hi!
|
| The point of the formula is to not offset A1 by any rows. All I want
it
to
| do is return an array of values and as I have it written that's what
it
| does. A1 is simply the start of the range. The end of the range
depends
| upon the COUNT of column A. If there's nothing in the range it doesn't
| matter because there's nothing to extract!
|
| Just to reduce any confusion, the extraction formula is on a different
| sheet so the reference to A1 in that formula is not the same reference
to
| A1 in the range name formula.
|
| Biff
|
| "Matt Lunn" wrote in message
| ...
| Biff,
|
| Your named range formula may be wrong. At the moment it will start
from
| A1
| but create a formula with 0 rows and (count of Column A) amount of
| columns.
| This may be why this is evaluating to 0 in your formula?
|
| Try
|
| =OFFSET(Sheet1!$A$1,,COUNT(Sheet1!$A:$A),1)
|
| Thanks,
| Matt
|
| "Biff" wrote:
|
| Hi!
|
| Filters aren't dynamic!
|
| There's nothing wrong with the named range formula:
|
| =OFFSET(Sheet1!$A$1,,,COUNT(Sheet1!$A:$A))
|
| The data is numeric.
|
| Biff
|
| "Matt Lunn" wrote in message
| ...
| Biff,
|
| Not sure why that isn't working but is it necessary to use this
| method?
|
| Could you use DataFilterAdvanced Filter?
|
| If your method is necessary please post details of the list
dynamic
| formula
| and the type of data it contains.
|
| Thanks,
| Matt
|
| "Biff" wrote:
|
| Hi Folks!
|
| Trying to extract uniques from a list and make it dynamic. It
works
| as
| long
| as there are at least 2 entries in the list. If there is only 1
entry
| in
| the
| list the formula errors but i don't understand why.
|
| The formula without the error trap: (array)
|
| =INDEX(List,MATCH(0,COUNTIF(A$1:A1,List),0))
|
| List is a dynamic range name.
|
| With only a single entry in List and A1 being empty, this is how
the
| formula
| evaluates:
|
| =INDEX({1},MATCH(0,0,0))
|
| Match returns #N/A when it should return 1 since 0 matches 0 and
it's
| in
| the
| first position of the lookup_array and the result of the entire
| formula
| shoud be 1 since 1 is in the first position of the Index array.
|
| Can anyone explain why this is not working?
|
| Thanks
|
| Biff
|
|
|
|
|
|
|
|
|
|
|
|
|




  #9   Report Post  
Domenic
 
Posts: n/a
Default

Hi Biff!

I think Scott has the answer. However, if I try...

=MATCH(0,A1,0)

....where A1 contains 0, the formula returns 1 not #N/A even though the
second argument is a single value and not an array. So I don't quite
understand why.

In article ,
"Biff" wrote:

Hi Folks!

Trying to extract uniques from a list and make it dynamic. It works as long
as there are at least 2 entries in the list. If there is only 1 entry in the
list the formula errors but i don't understand why.

The formula without the error trap: (array)

=INDEX(List,MATCH(0,COUNTIF(A$1:A1,List),0))

List is a dynamic range name.

With only a single entry in List and A1 being empty, this is how the formula
evaluates:

=INDEX({1},MATCH(0,0,0))

Match returns #N/A when it should return 1 since 0 matches 0 and it's in the
first position of the lookup_array and the result of the entire formula
shoud be 1 since 1 is in the first position of the Index array.

Can anyone explain why this is not working?

Thanks

Biff

  #10   Report Post  
Biff
 
Posts: n/a
Default

Thanks for taking a look, Domenic!

I don't like not understanding things.

Biff

"Domenic" wrote in message
...
Hi Biff!

I think Scott has the answer. However, if I try...

=MATCH(0,A1,0)

...where A1 contains 0, the formula returns 1 not #N/A even though the
second argument is a single value and not an array. So I don't quite
understand why.

In article ,
"Biff" wrote:

Hi Folks!

Trying to extract uniques from a list and make it dynamic. It works as
long
as there are at least 2 entries in the list. If there is only 1 entry in
the
list the formula errors but i don't understand why.

The formula without the error trap: (array)

=INDEX(List,MATCH(0,COUNTIF(A$1:A1,List),0))

List is a dynamic range name.

With only a single entry in List and A1 being empty, this is how the
formula
evaluates:

=INDEX({1},MATCH(0,0,0))

Match returns #N/A when it should return 1 since 0 matches 0 and it's in
the
first position of the lookup_array and the result of the entire formula
shoud be 1 since 1 is in the first position of the Index array.

Can anyone explain why this is not working?

Thanks

Biff





  #11   Report Post  
Biff
 
Posts: n/a
Default

Got it!

=INDEX(List,MATCH(0,INDEX(COUNTIF(A$1:A1,List),,1) ,0))

Biff

"Biff" wrote in message
...
Thanks for taking a look, Domenic!

I don't like not understanding things.

Biff

"Domenic" wrote in message
...
Hi Biff!

I think Scott has the answer. However, if I try...

=MATCH(0,A1,0)

...where A1 contains 0, the formula returns 1 not #N/A even though the
second argument is a single value and not an array. So I don't quite
understand why.

In article ,
"Biff" wrote:

Hi Folks!

Trying to extract uniques from a list and make it dynamic. It works as
long
as there are at least 2 entries in the list. If there is only 1 entry in
the
list the formula errors but i don't understand why.

The formula without the error trap: (array)

=INDEX(List,MATCH(0,COUNTIF(A$1:A1,List),0))

List is a dynamic range name.

With only a single entry in List and A1 being empty, this is how the
formula
evaluates:

=INDEX({1},MATCH(0,0,0))

Match returns #N/A when it should return 1 since 0 matches 0 and it's in
the
first position of the lookup_array and the result of the entire formula
shoud be 1 since 1 is in the first position of the Index array.

Can anyone explain why this is not working?

Thanks

Biff





  #12   Report Post  
Domenic
 
Posts: n/a
Default

In article ,
"Biff" wrote:

Got it!

=INDEX(List,MATCH(0,INDEX(COUNTIF(A$1:A1,List),,1) ,0))


Nice!

So it looks like the reason COUNTIF(...) alone doesn't work is that it
actually returns a single value, whereas INDEX(COUNTIF(...),,1) returns
a single element array.

So maybe the reason why...

=MATCH(0,A1,0)

....works is that the reference to A1 is actually considered a single
element array. Does it make sense?
  #13   Report Post  
Biff
 
Posts: n/a
Default

I guess this is just one of those unexplainable nuances that Excel throws at
us every now and then!

Biff

"Domenic" wrote in message
...
In article ,
"Biff" wrote:

Got it!

=INDEX(List,MATCH(0,INDEX(COUNTIF(A$1:A1,List),,1) ,0))


Nice!

So it looks like the reason COUNTIF(...) alone doesn't work is that it
actually returns a single value, whereas INDEX(COUNTIF(...),,1) returns
a single element array.

So maybe the reason why...

=MATCH(0,A1,0)

...works is that the reference to A1 is actually considered a single
element array. Does it make sense?



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
Excel - return a picture or range rows as the result of a formula juststarting Excel Worksheet Functions 1 July 4th 05 12:59 AM
check if reference exists, then return its value or return 0 doudou Excel Worksheet Functions 1 June 4th 05 09:17 PM
How do create a formula to evalute a # to return 1 of 4 conditions Larry Excel Worksheet Functions 4 May 29th 05 12:58 AM
Using a Vlookup to return values in a data list? rtjeter Excel Worksheet Functions 2 April 26th 05 05:56 AM
if the value of a cell in a range is not blank, then return the v. kvail Excel Worksheet Functions 2 April 8th 05 10:07 PM


All times are GMT +1. The time now is 02:07 PM.

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"