# Array Index formula to average 2 columns

#### sgs31

##### New Member
This is what I have and it works on other cells that I don't want averaged.

Code:
``=IFERROR(INDEX(Archive!\$U\$6:\$U\$10000, SMALL(IF(\$G\$4=Archive!\$B\$6:\$B\$10000, ROW(Archive!\$B\$6:\$B\$10000)-ROW(Archive!\$B\$6)+1), ROW(1:1))),"")``

For a few cells I want to average two different index locations. I tried...

Code:
``=IFERROR(INDEX(AVERAGE(Archive!\$U\$6:\$U\$10000,Archive!\$V\$6:\$V\$10000), SMALL(IF(\$G\$4=Archive!\$B\$6:\$B\$10000, ROW(Archive!\$B\$6:\$B\$10000)-ROW(Archive!\$B\$6)+1), ROW(1:1))),"")``

Obviously this didn't work!

Is there a way to average this without making a new column for index with averages already in place (a lot more work)?

Any help would be greatly appreciated.

### Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Shouldn't this:
=IFERROR(INDEX(AVERAGE...
be
=IFERROR(AVERAGE(INDEX...
like
=IFERROR(AVERAGE(INDEX1,INDEX2),"")
where Index1 returns first value...

Last edited:
I was thinking the same thing... but I still can't get it to work. I must be writing it out wrong.

Code:
``=(INDEX(Archive!\$U\$6:\$U\$10000,SMALL(IF(\$G\$4=Archive!\$B\$6:\$B\$10000,ROW(Archive!\$B\$6:\$B\$10000)-ROW(Archive!\$B\$6)+1),ROW(1:1)))+INDEX(Archive!\$V\$6:\$V\$10000,SMALL(IF(\$G\$4=Archive!\$B\$6:\$B\$10000,ROW(Archive!\$B\$6:\$B\$10000)-ROW(Archive!\$B\$6)+1),ROW(1:1))))/2``

couldn't figure it out so I just added and then divided... works good enough

Code:
``=IF(E7="","",(IFERROR((INDEX(Archive!\$U\$6:\$U\$10000,SMALL(IF(\$G\$4=Archive!\$B\$6:\$B\$10000,ROW(Archive!\$B\$6:\$B\$10000)-ROW(Archive!\$B\$6)+1),ROW(1:1)))+INDEX(Archive!\$V\$6:\$V\$10000,SMALL(IF(\$G\$4=Archive!\$B\$6:\$B\$10000,ROW(Archive!\$B\$6:\$B\$10000)-ROW(Archive!\$B\$6)+1),ROW(1:1)))),"")/2))``

Cleaned up some errors for anyone else that may stumble upon it.

Replies
9
Views
185
Replies
4
Views
220
Replies
7
Views
4K
Replies
10
Views
910
Replies
3
Views
629

1,196,048
Messages
6,013,087
Members
441,747
Latest member
darkman77

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back