Averaging only negative number in every other cell

BPMike

New Member
Joined
May 12, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a data set which includes positive and negative numbers. I am able to get my averages for every other cell using =AVERAGE(IF(ISEVEN(COLUMN(G4:DQ4))*(G4:DQ4<>""),G4:DQ4)) but I only need to average negative numbers and can't figure out how I should modify my formula.

Any help would be appreciated

Cheers,

Mike
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Forgot to upload a picture.
 

Attachments

  • Need only negative averages.png
    Need only negative averages.png
    16.4 KB · Views: 9
Upvote 0
Welcome to MrExcel,

Looking at your current formula, maybe:
Excel Formula:
=LET(r,G4:DQ4,AVERAGE(IF(ISEVEN(COLUMN(r))*(r<>"")*(r<0),r)))
 
Upvote 0
Welcome to the Board!

Here is one way:
Excel Formula:
=SUMPRODUCT(--(ISEVEN(COLUMN(G4:DQ4))),--(G4:DQ4<0),G4:DQ4)/SUMPRODUCT(--(ISEVEN(COLUMN(G4:DQ4))),--(G4:DQ4<0))
 
Upvote 0
Hi @BPMike .
Welcome to the MrExcel forum. Please accept my warmest greetings and sincere hope that all is well.

How about

Excel Formula:
=AVERAGEIF(G4:DQ4,"<0")
 
Upvote 0
How about

Excel Formula:
=AVERAGEIF(G4:DQ4,"<0")
Dante,
I think you may have missed the part of "every other cell".
It looks like they just want to include values in even numbered columns.
 
Upvote 0
Here's another way...

Excel Formula:
=AVERAGE(IF(ISEVEN(COLUMN(G4:DQ4)),IF(G4:DQ4<0,G4:DQ4)))

Hope this helps!
 
Upvote 0
Solution
I think you may have missed the part of "every other cell".
It looks like they just want to include values in even numbered columns.
Hi Joe, you're right, I missed that part. 😟

Here another proposal 😅

varios 12may2023.xlsm
E
4-3
Hoja6
Cell Formulas
RangeFormula
E4E4=SUM(IF(MOD(COLUMN(G4:Q4),2)=0,IF(G4:Q4<0,G4:Q4)))/COUNT(IF(MOD(COLUMN(G4:Q4),2)=0,IF(G4:Q4<0,1)))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Here's another way...

Excel Formula:
=AVERAGE(IF(ISEVEN(COLUMN(G4:DQ4)),IF(G4:DQ4<0,G4:DQ4)))

Hope this helps!
That worked perfectly. Thank you

And thanks everyone for the warm welcome :-)
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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?

Disable AdBlock

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
Back
Top