Modify to eliminate #NUM! error

G

Gotroots

The following formula works fine however it returns #NUM! when there are no
more records to display. I do not want the error to return.

=INDEX(INDIRECT("$a$1:$a$500"),MATCH(SMALL($C$1:$C$500,ROWS($IV$1:IV1)),$C$1:$C$500,0))
 
M

Ms-Exl-Learner

=IF(ISERROR(INDEX(INDIRECT("$a$1:$a$500"),MATCH(SMALL($C$1:$C$500,ROWS($IV$1:IV1)),$C$1:$C$500,0))),"",INDEX(INDIRECT("$a$1:$a$500"),MATCH(SMALL($C$1:$C$500,ROWS($IV$1:IV1)),$C$1:$C$500,0)))

Remember to Click Yes, if this post helps!
 
D

David Biddulph

The usual way of avoiding such errors being displayed is
=IF(ISERROR(yourformula),"",yourformula), hence try
=IF(ISERROR(INDEX(INDIRECT("$a$1:$a$500"),MATCH(SMALL($C$1:$C$500,ROWS($IV$1:IV1)),$C$1:$C$500,0))),"",INDEX(INDIRECT("$a$1:$a$500"),MATCH(SMALL($C$1:$C$500,ROWS($IV$1:IV1)),$C$1:$C$500,0)))
 
J

Jacob Skaria

Depends on what you have in ColA and colC

If ColC is having numerics...tr
=IF(COUNT($C$1:$C$500)<ROWS($IV$1:IV1),"",(INDEX(INDIRECT("$a$1:$a$500"),MATCH(SMALL($C$1:$C$500,ROWS($IV$1:IV1)),$C$1:$C$500,0))))

'try if colC will have both text and numeric
=IF(COUNTA($C$1:$C$500)<ROWS($IV$1:IV1),"",(INDEX(INDIRECT("$a$1:$a$500"),MATCH(SMALL($C$1:$C$500,ROWS($IV$1:IV1)),$C$1:$C$500,0))))
 
G

Gotroots

That is one heck of a formula! It does what it says on the tin :)

Thank you (Ms-Exl-Learner)
 
T

T. Valko

it returns #NUM! when there are no more records to display.

If the formula returns #NUM! it can only come from this:

SMALL(C1:C500,ROWS(IV$1:IV1))

So, you only need to trap that portion of the formula.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top