(Msg. 2) Posted: Tue Aug 26, 2008 5:57 pm
Post subject: Re: Selecting a Range [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
This is an ARRAY formula that must be entered using ctrl+shift+enter AND the
ranges must be the same size.
Don't use 2000 in one 2002 in another and 2013 in a third
=AVERAGE(IF(c17:c2000="sar",o17:o2000))
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1.DeleteThis@austin.rr.com
"JimS" <jimx22.DeleteThis@msn.com> wrote in message
news:stv8b4lr7gpl0gg0ke3ufs73t1qdegii3m@4ax.com...
> =IF(ISERROR(AVERAGE(O17:O2013)),0,(AVERAGE(O17:O2002)))
>
> I have this formula in a cell but I want to add a condition. I want
> it to average the data in question but only if:
>
> c17:c2000="sar"
>
> Whats the easiest way to insert that in there?
(Msg. 3) Posted: Tue Aug 26, 2008 6:10 pm
Post subject: Re: Selecting a Range [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
I figured you were returning 0 if there were numbers to average. And if there
are no numbers to average, then the =sumif() portion would be 0. But so would
the =countif(). So I made sure I had a non-zero denominator using the =max()
function.
And watch your ranges. I would expect them to be the same number of rows.
JimS wrote:
>
> =IF(ISERROR(AVERAGE(O17:O2013)),0,(AVERAGE(O17:O2002)))
>
> I have this formula in a cell but I want to add a condition. I want
> it to average the data in question but only if:
>
> c17:c2000="sar"
>
> Whats the easiest way to insert that in there?
(Msg. 4) Posted: Tue Aug 26, 2008 8:32 pm
Post subject: Re: Selecting a Range [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Thanks you guys. I don't know why my ranges change like that. I put
2000 in all of them, but for some reason they move around.
On Tue, 26 Aug 2008 18:10:31 -0500, Dave Peterson
<petersod RemoveThis @verizonXSPAM.net> wrote:
>Another one:
>
>=sumif(c17:c2000,"sar",o17:o2000)/max(1,countif(c17:c2000,"sar"))
>
>I figured you were returning 0 if there were numbers to average. And if there
>are no numbers to average, then the =sumif() portion would be 0. But so would
>the =countif(). So I made sure I had a non-zero denominator using the =max()
>function.
>
>And watch your ranges. I would expect them to be the same number of rows.
>
>JimS wrote:
>>
>> =IF(ISERROR(AVERAGE(O17:O2013)),0,(AVERAGE(O17:O2002)))
>>
>> I have this formula in a cell but I want to add a condition. I want
>> it to average the data in question but only if:
>>
>> c17:c2000="sar"
>>
>> Whats the easiest way to insert that in there?
(Msg. 5) Posted: Wed Aug 27, 2008 3:03 am
Post subject: Re: Selecting a Range [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
The core expression, array-entered*:
=AVERAGE(IF(C17:C2002="sar",O17:O2002))
*press CTRL+SHIFT+ENTER to confirm the formula
With the error trap, array-entered*:
=IF(ISERROR(AVERAGE(IF(C17:C2002="sar",O17:O2002))),0,AVERAGE(IF(C17:C2002="sar",O17:O2002)))
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:17,500 Files:358 Subscribers:55
xdemechanik
---
"JimS" <jimx22.RemoveThis@msn.com> wrote in message
news:stv8b4lr7gpl0gg0ke3ufs73t1qdegii3m@4ax.com...
> =IF(ISERROR(AVERAGE(O17:O2013)),0,(AVERAGE(O17:O2002)))
>
> I have this formula in a cell but I want to add a condition. I want
> it to average the data in question but only if:
>
> c17:c2000="sar"
>
> Whats the easiest way to insert that in there?
(Msg. 6) Posted: Wed Aug 27, 2008 3:03 am
Post subject: Re: Selecting a Range [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
I have one more question about this formula. In column C I have the
abbreviated names of places
bel
sar
emd
etc.
How could I make this formula work with whatever I put into cell L2?
In other words cell L2 has "sar" so that's what I want to average. If
I change cell L2 it to emd then it looks for emd and averages that.
On Wed, 27 Aug 2008 06:59:37 +0800, "Max" <demechanik.RemoveThis@yahoo.com>
wrote:
>The core expression, array-entered*:
>=AVERAGE(IF(C17:C2002="sar",O17:O2002))
>
>*press CTRL+SHIFT+ENTER to confirm the formula
>
>With the error trap, array-entered*:
>=IF(ISERROR(AVERAGE(IF(C17:C2002="sar",O17:O2002))),0,AVERAGE(IF(C17:C2002="sar",O17:O2002)))
(Msg. 7) Posted: Wed Aug 27, 2008 3:03 am
Post subject: Re: Selecting a Range [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
On Tue, 26 Aug 2008 21:08:54 -0700, JimS <jimx22.DeleteThis@msn.com> wrote:
>I have one more question about this formula. In column C I have the
>abbreviated names of places
>
>bel
>sar
>emd
>
>etc.
>
>How could I make this formula work with whatever I put into cell L2?
>In other words cell L2 has "sar" so that's what I want to average. If
>I change cell L2 it to emd then it looks for emd and averages that.
>
>On Wed, 27 Aug 2008 06:59:37 +0800, "Max" <demechanik.DeleteThis@yahoo.com>
>wrote:
>
>>The core expression, array-entered*:
>>=AVERAGE(IF(C17:C2002="sar",O17:O2002))
>>
>>*press CTRL+SHIFT+ENTER to confirm the formula
>>
>>With the error trap, array-entered*:
>>=IF(ISERROR(AVERAGE(IF(C17:C2002="sar",O17:O2002))),0,AVERAGE(IF(C17:C2002="sar",O17:O2002)))
(Msg. 8) Posted: Wed Aug 27, 2008 2:20 pm
Post subject: Re: Selecting a Range [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
To point to a cell, L2,
which will contain the text: sar (w/o the double quotes)
Then just copy M2 down as far as required
to return the corresponding results for each value in L2, l3, L4 etc
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:17,500 Files:358 Subscribers:55
xdemechanik
---
"JimS" <jimx22.DeleteThis@msn.com> wrote in message
news:ckk9b4pnl0crm4ck94u7tg2cg9gvsv25ve@4ax.com...
>I have one more question about this formula. In column C I have the
> abbreviated names of places
>
> bel
> sar
> emd
>
> etc.
>
> How could I make this formula work with whatever I put into cell L2?
> In other words cell L2 has "sar" so that's what I want to average. If
> I change cell L2 it to emd then it looks for emd and averages that.
All times are: Eastern Time (US & Canada) (change) Goto page 1, 2
Page 1 of 2
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum