Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
David
 
Posts: n/a
Default Average AM or PM values

ColumnA alternates between text "AM" and "PM"
ColumnC contains corresponding numbers/values
I want two formulas to put in Column E:
1) Average "AM" values
2) Average "PM" values

Should be simple, but I can't get it right.
Any help?

--
David
  #2   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson
 
Posts: n/a
Default Average AM or PM values

David,

Try the following array formula:

=AVERAGE(IF(A1:A5="am",C1:C5,FALSE))

Change the ranges to suit your needs. Since this is an array
formula, you must press CTRL+SHIFT+ENTER rather than just ENTER
when you first enter the formula and whenever you edit it later.
If you do this properly, Excel will display the formula enclosed
in curly braces {}.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"David" wrote in message
...
ColumnA alternates between text "AM" and "PM"
ColumnC contains corresponding numbers/values
I want two formulas to put in Column E:
1) Average "AM" values
2) Average "PM" values

Should be simple, but I can't get it right.
Any help?

--
David



  #3   Report Post  
Posted to microsoft.public.excel.misc
Fred Smith
 
Posts: n/a
Default Average AM or PM values

You should be able to use Sum/Count, as in:

=sumif(C:C,"AM",A:A)/countif(A:A,"AM")

--
Regards,
Fred


"David" wrote in message
...
ColumnA alternates between text "AM" and "PM"
ColumnC contains corresponding numbers/values
I want two formulas to put in Column E:
1) Average "AM" values
2) Average "PM" values

Should be simple, but I can't get it right.
Any help?

--
David



  #4   Report Post  
Posted to microsoft.public.excel.misc
Elkar
 
Posts: n/a
Default Average AM or PM values

Try this:

=SUMIF(A1:A100,"AM",C1:C100)/COUNTIF(A1:A100,"AM")

=SUMIF(A1:A100,"PM",C1:C100)/COUNTIF(A1:A100,"PM")

HTH,
Elkar

"David" wrote:

ColumnA alternates between text "AM" and "PM"
ColumnC contains corresponding numbers/values
I want two formulas to put in Column E:
1) Average "AM" values
2) Average "PM" values

Should be simple, but I can't get it right.
Any help?

--
David

  #5   Report Post  
Posted to microsoft.public.excel.misc
Peo Sjoblom
 
Posts: n/a
Default Average AM or PM values

Are these real times that excel sees at time, if so

=AVERAGE(IF(C1:C30<=TIME(11,59,59),C1:C30))

for AM

=AVERAGE(IF(C1:C30=TIME(12,,),C1:C30))


for PM

both entered with ctrl + shift & enter


--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com



"David" wrote in message
...
ColumnA alternates between text "AM" and "PM"
ColumnC contains corresponding numbers/values
I want two formulas to put in Column E:
1) Average "AM" values
2) Average "PM" values

Should be simple, but I can't get it right.
Any help?

--
David





  #6   Report Post  
Posted to microsoft.public.excel.misc
Peo Sjoblom
 
Posts: n/a
Default Average AM or PM values

Nevermind, I misunderstood

Peo


"Peo Sjoblom" wrote in message
...
Are these real times that excel sees at time, if so

=AVERAGE(IF(C1:C30<=TIME(11,59,59),C1:C30))

for AM

=AVERAGE(IF(C1:C30=TIME(12,,),C1:C30))


for PM

both entered with ctrl + shift & enter


--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com



"David" wrote in message
...
ColumnA alternates between text "AM" and "PM"
ColumnC contains corresponding numbers/values
I want two formulas to put in Column E:
1) Average "AM" values
2) Average "PM" values

Should be simple, but I can't get it right.
Any help?

--
David





  #7   Report Post  
Posted to microsoft.public.excel.misc
David
 
Posts: n/a
Default Average AM or PM values

Fred Smith wrote

You should be able to use Sum/Count, as in:

=sumif(C:C,"AM",A:A)/countif(A:A,"AM")


I had to change it to:
=SUMIF(A:A,"AM",C:C)/COUNTIF(A:A,"AM")
changing "AM" to "PM" for second forumla

I chose your solution because the range will grow.
Many thanks.

--
David
  #8   Report Post  
Posted to microsoft.public.excel.misc
David
 
Posts: n/a
Default Average AM or PM values

Chip Pearson wrote

David,

Try the following array formula:

=AVERAGE(IF(A1:A5="am",C1:C5,FALSE))

Change the ranges to suit your needs. Since this is an array
formula, you must press CTRL+SHIFT+ENTER rather than just ENTER
when you first enter the formula and whenever you edit it later.
If you do this properly, Excel will display the formula enclosed
in curly braces {}.



Yep, that works for a fixed range, but I will be adding to the range, so I
chose Fred's solution. Thanks for your help.

--
David
  #9   Report Post  
Posted to microsoft.public.excel.misc
David
 
Posts: n/a
Default Average AM or PM values

Easily changed to match my "fixed" version of Fred's offering to allow for
unlimited expansion. Many thanks.

--
David

?B?RWxrYXI=?= wrote

Subject: Average AM or PM values
From: ?B?RWxrYXI=?=
Newsgroups: microsoft.public.excel.misc

Try this:

=SUMIF(A1:A100,"AM",C1:C100)/COUNTIF(A1:A100,"AM")

=SUMIF(A1:A100,"PM",C1:C100)/COUNTIF(A1:A100,"PM")

HTH,
Elkar

"David" wrote:

ColumnA alternates between text "AM" and "PM"
ColumnC contains corresponding numbers/values
I want two formulas to put in Column E:
1) Average "AM" values
2) Average "PM" values

Should be simple, but I can't get it right.
Any help?

--
David

  #10   Report Post  
Posted to microsoft.public.excel.misc
Fred Smith
 
Posts: n/a
Default Average AM or PM values

I'm glad it worked for you. Sorry about my dyslexic Sumif function.

--
Regards,
Fred


"David" wrote in message
...
Fred Smith wrote

You should be able to use Sum/Count, as in:

=sumif(C:C,"AM",A:A)/countif(A:A,"AM")


I had to change it to:
=SUMIF(A:A,"AM",C:C)/COUNTIF(A:A,"AM")
changing "AM" to "PM" for second forumla

I chose your solution because the range will grow.
Many thanks.

--
David



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
Average Values / Multiple Worksheets George Reis Excel Worksheet Functions 5 January 31st 06 10:27 PM
Conditional math using AND, Average Team ZR-1 Excel Worksheet Functions 12 January 19th 06 10:59 PM
Count Intervals of Filtered TEXT values in Column and Return Count across a Row Sam via OfficeKB.com Excel Worksheet Functions 9 July 31st 05 03:37 AM
How to average a column, but exclude zero AND negative values? KMHarpe Excel Discussion (Misc queries) 1 July 20th 05 10:06 PM
How do I average a formula without calculating zero values? KMHarpe Excel Discussion (Misc queries) 1 July 20th 05 06:05 PM


All times are GMT +1. The time now is 06:07 AM.

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

About Us

"It's about Microsoft Excel"