On Thu, 21 Feb 2008 at 14:41:46, T. Valko <(E-Mail Removed)> wrote
in microsoft.public.excel :
>>is there a way of counting the number of (non-empty) cells to left of the
>>maximum value, and also to the right of it?
>>In the above example, the answer to both should be 9
>
>If you meant *minimum*
Yes.
> then the answer would be 9 and 9.
>
>Try this based on the *first instance of the minimum* :
>
>For the count to the left of the *first instance of the minimum* :
>
>=IF(COUNT(A1:S1),COUNT(A1:INDEX(A1:S1,MATCH(MIN(A1:S1),A1:S1,0)))-1,0)
>
>For the count to the right of the *first instance of the minimum* :
>
>=IF(COUNT(A1:S1),COUNT(S1:INDEX(A1:S1,MATCH(MIN(A1:S1),A1:S1,0)))-1,0)
>
I'll try this, though I should read up on what Index & Match do, as I
won't know what's going on otherwise.
Well it does what I want for instances to the left of the minimum value,
but fails on the RHS if the minimum value occurs more than once in the
list, though the latter isn't too important.
Thanks.
--
Paul Hyett, Cheltenham (change 'invalid83261' to 'blueyonder' to email me)