# How to get an array formula to work both vertically and horizontally?

1. ## How to get an array formula to work both vertically and horizontally?

Hi Team Excel I am at a loss as to why this array formula works for my horizontal values but wont work vertically. I am sure there is a simple reason, but i am still learning all this and i dont know what it is, please help.

Attached is a very simple table. It contains letter grades, which are then reference a number value from another table (_Reports) to give it a numerical value, so that it can then be averaged, before changing it back into a Letter grade again. This works if i place the array formula in the horizontal average cell, but wont work if i try an average down a column.  Register To Reply

2. ## Re: How to get an array formula to work both vertically and horizontally?  Register To Reply

3. ## Re: How to get an array formula to work both vertically and horizontally?

For the columns, you need to transpose the lookup arrays:  Register To Reply

4. ## Re: How to get an array formula to work both vertically and horizontally?

Thank you, that worked a treat. Can you please explain what is happening here, so i can increase my understanding of excel. Cheers.

No dramas if you cant/dont want too   Register To Reply

5. ## Re: How to get an array formula to work both vertically and horizontally?

Which one of us are you addressing? You have been offered two solutions.

Use the Evaluate Formula option on the Formulas ribbon to step through it so you can see what is happening. Essentially in mine, because you were working with rows in the main table and columns in the lookup table, you need to switch this when you want to work with columns in the main table. TRANSPOSE simply turns the lookup arrays 90 degrees to facilitate this.  Register To Reply

6. ## Re: How to get an array formula to work both vertically and horizontally?

Hi Ali,

Either, what does Transposing do? Why is it needed for vertical rather than horizontal?  Register To Reply

7. ## Re: How to get an array formula to work both vertically and horizontally?

Glenn's approach is the same, but he's chosen to transpose the main table column instead. Essentially, one or other of the arrays needs transposing.  Register To Reply

8. ## Re: How to get an array formula to work both vertically and horizontally?  Register To Reply

9. ## Re: How to get an array formula to work both vertically and horizontally?

In your original (working) formula, the construction of the formula meant that you were multiplying two arrays. One (sheet 1) was a horizontal array, and the other (Codes) was a vertical array. When multiplied together they produced a 4 x 15 array of TRUE/FALSE responses.

In your original (non-working) formula, the two arrays were vertical. When multiplied together The first four rows of the codes array were searched for the 4 values in sheet 1. the remaining 11 rows of codes produced an error and the formual fell over. To get it to work, you had to coerce Excel to make one of the arrays horizonatal. That's what TRANSPOSE does.  Register To Reply

10. ## Re: How to get an array formula to work both vertically and horizontally?

Thank you both, youre awesome. I figured it was something like this, but it is always good to ask and seek clarification from those in the know.

Thank you for your help and support again.  Register To Reply

11. ## Re: How to get an array formula to work both vertically and horizontally?  Register To Reply