Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
NCINDASUN
 
Posts: n/a
Default Between? Is there a way?

I'd like to count the number of cells in a range whose value is between two
preset numbers. I would imagine that it would be something like

=countif(between(a1:a10,20,30))

but there doesn't seem to be a "between" function.

Can anyone help? Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB
 
Posts: n/a
Default Between? Is there a way?

where minimum and maximum are named cell references

=COUNTIF(A7:A17,""&Minimum)-COUNTIF(A7:A17,""&Maximum)

"NCINDASUN" wrote:

I'd like to count the number of cells in a range whose value is between two
preset numbers. I would imagine that it would be something like

=countif(between(a1:a10,20,30))

but there doesn't seem to be a "between" function.

Can anyone help? Thanks

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default Between? Is there a way?

JMB wrote...
where minimum and maximum are named cell references

=COUNTIF(A7:A17,""&Minimum)-COUNTIF(A7:A17,""&Maximum)

....

That includes entries in A7:A17 equal to Maximum but not equal to
Minimum. If the OP wants to include both bounds in the count,

=COUNTIF(Rng,"="&Min)-COUNTIF(Rng,""&Max)

If the OP wants to exclude both min and max bounds from the count,

=COUNTIF(Rng,""&Min)-COUNTIF(Rng,"="&Max)

To include items equal to min but exclude items equal to max,

=COUNTIF(Rng,"="&Min)-COUNTIF(Rng,"="&Max)

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ufo_pilot
 
Posts: n/a
Default Between? Is there a way?

=IF(A1A2,"LARGE",IF(A1<A3,"SMALL","OK"))

The numeric version for an overview:
=IF(A11000,1,IF(A1<1000,-1,0))

"Harlan Grove" wrote:

JMB wrote...
where minimum and maximum are named cell references

=COUNTIF(A7:A17,""&Minimum)-COUNTIF(A7:A17,""&Maximum)

....

That includes entries in A7:A17 equal to Maximum but not equal to
Minimum. If the OP wants to include both bounds in the count,

=COUNTIF(Rng,"="&Min)-COUNTIF(Rng,""&Max)

If the OP wants to exclude both min and max bounds from the count,

=COUNTIF(Rng,""&Min)-COUNTIF(Rng,"="&Max)

To include items equal to min but exclude items equal to max,

=COUNTIF(Rng,"="&Min)-COUNTIF(Rng,"="&Max)


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default Between? Is there a way?

ufo_pilot wrote...
....
The numeric version for an overview:
=IF(A11000,1,IF(A1<1000,-1,0))

....

So clever! But why not

=SIGN(A1-1000)

? Or don't you like short and simple?



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



All times are GMT +1. The time now is 02:27 PM.

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"