Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 143
Default Average based on the previous row

Hi All,

in row 2 I have dates jan 1 to jun 31
in row 3 I have some data.
now if in cell A60 i need the average of the data in row 3 only for
January....so if Jan starts in cell B2 and ends in cell AF2, I need the
average of data in B3 to AF3

please help.
Thanks


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,696
Default Average based on the previous row

=SUMPRODUCT(--(MONTH(B2:AF2)=1),--(B3:AF3))

"Gary" wrote:

Hi All,

in row 2 I have dates jan 1 to jun 31
in row 3 I have some data.
now if in cell A60 i need the average of the data in row 3 only for
January....so if Jan starts in cell B2 and ends in cell AF2, I need the
average of data in B3 to AF3

please help.
Thanks



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Average based on the previous row

Try this:

=AVERAGE(IF(MONTH(B2:AF2)=1,B3:AF3))

This is an array formula, so once you have typed it in (or
subsequently edit it) you should commit it with CTRL-SHIFT-ENTER (CSE)
instead of just ENTER. If you do this correctly then Excel will wrap
curly braces { } around the formula when viewed in the formula bar -
you should not type these yourself.

Change the 1 to a 2 for February, etc.

Hope this helps.

Pete


On Feb 5, 10:53 pm, "Gary" wrote:
Hi All,

in row 2 I have dates jan 1 to jun 31
in row 3 I have some data.
now if in cell A60 i need the average of the data in row 3 only for
January....so if Jan starts in cell B2 and ends in cell AF2, I need the
average of data in B3 to AF3

please help.
Thanks



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Average based on the previous row

Try this:

I'm assuming there are no empty cells in row 2.

Entered as an array using the key combination of CTRL,SHIFT,ENTER (not just
ENTER):

=AVERAGE(IF(MONTH(B2:FZ2)=1,B3:FZ3))

Biff

"Gary" wrote in message
...
Hi All,

in row 2 I have dates jan 1 to jun 31
in row 3 I have some data.
now if in cell A60 i need the average of the data in row 3 only for
January....so if Jan starts in cell B2 and ends in cell AF2, I need the
average of data in B3 to AF3

please help.
Thanks



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default Average based on the previous row

Hi Gary

One way

=SUMPRODUCT((MONTH(B2:AF2)=1)*(B2:AF2<"")*B3:AF3)/
SUMPRODUCT((MONTH(B2:AF2)=1)*(B2:AF<""))

--
Regards

Roger Govier


"Gary" wrote in message
...
Hi All,

in row 2 I have dates jan 1 to jun 31
in row 3 I have some data.
now if in cell A60 i need the average of the data in row 3 only for
January....so if Jan starts in cell B2 and ends in cell AF2, I need
the average of data in B3 to AF3

please help.
Thanks





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 143
Default Average based on the previous row

Thanks a lot all of you.

:)

"Roger Govier" wrote in message
...
Hi Gary

One way

=SUMPRODUCT((MONTH(B2:AF2)=1)*(B2:AF2<"")*B3:AF3)/
SUMPRODUCT((MONTH(B2:AF2)=1)*(B2:AF<""))

--
Regards

Roger Govier


"Gary" wrote in message
...
Hi All,

in row 2 I have dates jan 1 to jun 31
in row 3 I have some data.
now if in cell A60 i need the average of the data in row 3 only for
January....so if Jan starts in cell B2 and ends in cell AF2, I need the
average of data in B3 to AF3

please help.
Thanks





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
formatting cell number based on previous cell number Pasquini Excel Discussion (Misc queries) 3 June 20th 06 06:36 AM
calculate average in a column based on criteria in another column sharon t Excel Discussion (Misc queries) 2 May 12th 06 06:07 PM
conditional cell format based on cell in same row, previous column tamiluchi Excel Worksheet Functions 7 May 3rd 06 04:11 PM
Error Handling #N/A with AVERAGE Function - Average of values in Row Sam via OfficeKB.com Excel Worksheet Functions 13 July 31st 05 03:59 PM
Match Last Occurrence of two numbers and Count to Previous Occurence Sam via OfficeKB.com Excel Worksheet Functions 33 April 4th 05 02:17 PM


All times are GMT +1. The time now is 02:14 AM.

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

About Us

"It's about Microsoft Excel"