WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Selecting a Range

 
Goto page 1, 2
   Home -> Office -> General Discussions RSS
Next:  XIRR with more than two columns  
Author Message
JimS

External


Since: Jul 28, 2008
Posts: 113



(Msg. 1) Posted: Tue Aug 26, 2008 3:42 pm
Post subject: Selecting a Range
Archived from groups: microsoft>public>excel (more info?)

=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?
Back to top
Login to vote
Don Guillett

External


Since: Jan 04, 2006
Posts: 2753



(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?
Back to top
Login to vote
Dave Peterson

External


Since: Jul 08, 2005
Posts: 9018



(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?)

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?

--

Dave Peterson
Back to top
Login to vote
JimS

External


Since: Jul 28, 2008
Posts: 113



(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?
Back to top
Login to vote
Max

External


Since: Sep 08, 2003
Posts: 1627



(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?
Back to top
Login to vote
JimS

External


Since: Jul 28, 2008
Posts: 113



(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)))
Back to top
Login to vote
JimS

External


Since: Jul 28, 2008
Posts: 113



(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?)

Got it.

Entered as array:

=IF(ISERROR(AVERAGE(IF(C17:C2002=L2,O17:O2002))),0,AVERAGE(IF(C17:C2002=L2,O17:O2002)))

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)))
Back to top
Login to vote
Max

External


Since: Sep 08, 2003
Posts: 1627



(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)

The 2 array-entered expressions will be simply:

=AVERAGE(IF(C17:C2002=L2,O17:O2002))

=IF(ISERROR(AVERAGE(IF(C17:C2002=L2,O17:O2002))),0,
AVERAGE(IF(C17:C2002=L2,O17:O2002)))

And if you have a list of text entered in L2 down (ie in L2, L3, L4, etc)
just fix the ranges like this in your start cell, say in M2:

=AVERAGE(IF(C$17:C$2002=L2,O$17:O$2002))

=IF(ISERROR(AVERAGE(IF(C$17:C$2002=L2,O$17:O$2002))),0,
AVERAGE(IF(C$17:C$2002=L2,O$17:O$2002)))

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.
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> General Discussions 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
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET