A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

compare cells in column to criteria, then average next column cell



 
 
Thread Tools Display Modes
  #1  
Old July 21st, 2008, 07:36 PM posted to microsoft.public.excel.worksheet.functions
Bradwin
external usenet poster
 
Posts: 23
Default compare cells in column to criteria, then average next column cell

I have a spreadsheet that has two columns. I want to search through the
first column for a specific value, and if the value is met, average the value
in the cell adjacent in the next column to previous values returned. The
formula
=IF(ISERROR(AVERAGE(IF(D$2:$D$1001=1,$E$2:$E$1001) )),0,(AVERAGE(IF($D$2:=1,$E$2:$E$1001))))
is supposed look for a 1 in column D, and if it is there, add the value in
column E to a running average. It does not work.
  #2  
Old July 21st, 2008, 08:02 PM posted to microsoft.public.excel.worksheet.functions
John C[_2_]
external usenet poster
 
Posts: 1,350
Default compare cells in column to criteria, then average next column cell

If you are just looking for an overall overage of the values in column E if
the value in column D meets certain criteria, you can use the following
formula:
=SUMPRODUCT(--($D$2:$D$1001=1),($E$2:$E$1001))/COUNTIF($D$2:$D$1001,1)

If, however, say in column F, you are looking for a 'running' average of the
values in column E if column D meets certain criteria, you could type the
following in column F2 and copy down as needed:
=IF(OR(D2="",E2=""),"",IF(D2=1,SUMPRODUCT(--(D$22=1),(E$2:E2))/COUNTIF(D$22,1),""))

--
John C


"Bradwin" wrote:

I have a spreadsheet that has two columns. I want to search through the
first column for a specific value, and if the value is met, average the value
in the cell adjacent in the next column to previous values returned. The
formula
=IF(ISERROR(AVERAGE(IF(D$2:$D$1001=1,$E$2:$E$1001) )),0,(AVERAGE(IF($D$2:=1,$E$2:$E$1001))))
is supposed look for a 1 in column D, and if it is there, add the value in
column E to a running average. It does not work.

  #3  
Old July 21st, 2008, 08:37 PM posted to microsoft.public.excel.worksheet.functions
Bradwin
external usenet poster
 
Posts: 23
Default compare cells in column to criteria, then average next column

Thank you, the first formula below works quite well.

"John C" wrote:

If you are just looking for an overall overage of the values in column E if
the value in column D meets certain criteria, you can use the following
formula:
=SUMPRODUCT(--($D$2:$D$1001=1),($E$2:$E$1001))/COUNTIF($D$2:$D$1001,1)

If, however, say in column F, you are looking for a 'running' average of the
values in column E if column D meets certain criteria, you could type the
following in column F2 and copy down as needed:
=IF(OR(D2="",E2=""),"",IF(D2=1,SUMPRODUCT(--(D$22=1),(E$2:E2))/COUNTIF(D$22,1),""))

--
John C


"Bradwin" wrote:

I have a spreadsheet that has two columns. I want to search through the
first column for a specific value, and if the value is met, average the value
in the cell adjacent in the next column to previous values returned. The
formula
=IF(ISERROR(AVERAGE(IF(D$2:$D$1001=1,$E$2:$E$1001) )),0,(AVERAGE(IF($D$2:=1,$E$2:$E$1001))))
is supposed look for a 1 in column D, and if it is there, add the value in
column E to a running average. It does not work.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:50 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.