1

I have 5 numbers entered in cells B1:F1. If I write the following formula:

= MIN( OFFSET( A1, 0, {1,3,5} ) )

then it correctly returns the smallest of the numbers in cells B1, D1, F1. However, if I get rid of the MIN() and make the formula:

= OFFSET( A1, 0, {1,3,5} )

I would expect it to return the 3 numbers as a dynamic array. It does return a dynamic array sized correctly, but in each of the 3 cells it gives me #VALUE!. That would seem to be a bug - and I know dynamic arrays are relatively new - but would anybody have any thoughts to the contrary? Thanks.

2 Answers 2

4

It's probably better to just use INDEX as it's not volatile.

=INDEX(B1:F1,,{1,3,5})

EDIT:

For a more general version of this, consider:

=INDEX(1:1,,{2, 4, 6})

or

=INDEX(1:1,,{1, 3, 5}+1)
Sign up to request clarification or add additional context in comments.

2 Comments

Good answer. A more general soultion: =INDEX(1:1,,{2, 4, 6}) or =INDEX(1:1,,{1, 3, 5}+1)
@chrisneilsen - yep, that's good detail, will add to the body of the question.
0

Never mind! It now works, but I didn't change anything. It must be caused somehow by the fact that OFFSET is a volatile function...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.