# averageif formula with an array in excel

#### ErnieCooper

##### New Member
Hello,

I'm trying to get an average of the lowest points in a set of data (average lowest stock level before a delivery comes in, truth-be-told).
I've got a macro that adds a column each day with the stock level on it and want to know the average turning point on that graph.
So far I can do it with another column and an 'if' function that looks to see whether it is lower than both the day before and the day after.
I can then averageif off that.

However, I want to be able to run an averageifs on the actual line showing the average of the numbers that are lesser than both the number before and the number after.

Can anyone help me?7

### Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
 C E F G H I J K L M N O 1 Product 22/12/2021 21/12/2021 20/12/2021 17/12/2021 16/12/2021 15/12/2021 14/12/2021 13/12/2021 10/12/2021 09/12/2021 08/12/2021 2 WAP20 0​ 0​ 0​ 0​ 0​ 0​ 0​ 0​ 0​ 0​ 0​ 3 WAP27 21.4415677​ 20.5515677​ 19.5755677​ 20.1139117​ 16.8013457​ 16.8013457​ 15.1593457​ 15.1593457​ 15.1593457​ 15.7483561​ 15.7483561​ 4 WAP34 31.6696682​ 31.6696682​ 31.6696682​ 32.3563628​ 28.8839148​ 28.8839148​ 29.0264836​ 29.0264836​ 29.0264836​ 28.9774836​ 29.4122348​ 5 WAP41 26.7614388​ 26.7614388​ 26.7614388​ 27.3317898​ 25.2567898​ 25.2567898​ 25.4101298​ 23.5470788​ 23.5470788​ 23.8954558​ 24.5204981​ 6 WAP54 15.2251974​ 15.2251974​ 15.2251974​ 15.2251974​ 15.1803094​ 15.1803094​ 11.7191714​ 11.7191714​ 11.9423426​ 12.5529422​ 13.5060476​

A new column is added to this each morning with the current date.
I need to average all points in a single row that are lesser than the two points either side of it.
Id est: G3 is lower than H3 and F3.

Thanks,

Replies
0
Views
227
Replies
2
Views
212
Replies
3
Views
792
Replies
8
Views
193
Replies
1
Views
379

1,196,252
Messages
6,014,264
Members
441,809
Latest member
pawansher2002

### 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.
Allow Ads at MrExcel

### Which adblocker are you using?

Follow these easy steps to disable AdBlock

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

### Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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