Formula to count cells ignoring highest and lowest values

B

Baldy

Hi there

Can anyone advise whether it's possible to use VBA, or a formula, to
count a range of cells whilst ignoring the highest and lowest values in
that range?

Thanks
 
I

Immanuel

Assuming your range of cells is defined as "rng", use the following array
formula:

=SUM(IF((rng<MAX(rng))*(rng>MIN(rng)),1,0))

Remember to hit Ctrl-Shift Enter instead of just Enter after typing (or
pasting) in the formula.

/i.
 
K

Ken Wright

All depends - OP really needs to clarify the question. Apply your logic to the
following:-

3
3
5
7
8
9
9
9

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 00/02/03

----------------------------------------------------------------------------
Attitude - A little thing that makes a BIG difference
----------------------------------------------------------------------------



Alan said:
Would'nt =COUNT(A1:A20)-2 do it?
 
A

Alan

Right on both counts!
Ken Wright said:
All depends - OP really needs to clarify the question. Apply your logic to the
following:-

3
3
5
7
8
9
9
9

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 00/02/03

-------------------------------------------------------------------------- --
Attitude - A little thing that makes a BIG difference
-------------------------------------------------------------------------- --
 

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