A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Count based on cell value between two numbers



 
 
Thread Tools Display Modes
  #1  
Old April 21st, 2010, 09:17 PM posted to microsoft.public.excel.misc
joemc911
external usenet poster
 
Posts: 12
Default Count based on cell value between two numbers

Perhaps for the more experienced this is easy. I hope so.

I want to build a sheet that scores a point value based on data entered in
one cell. I would like to score a point for any number between 1 and 20, two
points for any number between 21 and 40, etc... I imagine it's some version
of an IF formula but I can't seem to figure it out.

Any help would be appreciated. Thanks in advance!
  #2  
Old April 21st, 2010, 09:28 PM posted to microsoft.public.excel.misc
Mike H
external usenet poster
 
Posts: 8,419
Default Count based on cell value between two numbers

Hi,

Try this

=IF(A1,LOOKUP(A1,{0,21,41,61},{1,2,3,4}),"")

The if(a1 bit makes it return nothing if a1 is empty. After that 1 to 20
returns 1, 2 to 40 =2 etc.
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"joemc911" wrote:

Perhaps for the more experienced this is easy. I hope so.

I want to build a sheet that scores a point value based on data entered in
one cell. I would like to score a point for any number between 1 and 20, two
points for any number between 21 and 40, etc... I imagine it's some version
of an IF formula but I can't seem to figure it out.

Any help would be appreciated. Thanks in advance!

  #3  
Old April 21st, 2010, 09:34 PM posted to microsoft.public.excel.misc
Bernard Liengme
external usenet poster
 
Posts: 516
Default Count based on cell value between two numbers

My numbers are in column A
In B1 I have =INT(A1/20)+1; this is copied down the column
Seems to do what you want
5 1
20 2
30 2
39 2
40 3
41 3
60 4
70 4
79 4
80 5
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"joemc911" wrote in message
...
Perhaps for the more experienced this is easy. I hope so.

I want to build a sheet that scores a point value based on data entered in
one cell. I would like to score a point for any number between 1 and 20,
two
points for any number between 21 and 40, etc... I imagine it's some
version
of an IF formula but I can't seem to figure it out.

Any help would be appreciated. Thanks in advance!


  #4  
Old April 21st, 2010, 09:45 PM posted to microsoft.public.excel.misc
joemc911
external usenet poster
 
Posts: 12
Default Count based on cell value between two numbers

Perfect! Thanks Mike! I didn't really understand the lookup function but I
was able to use your formula and teach myself a little of what the lookup did
and how to use it. Exactly what I was hoping to get from here!

"Mike H" wrote:

Hi,

Try this

=IF(A1,LOOKUP(A1,{0,21,41,61},{1,2,3,4}),"")

The if(a1 bit makes it return nothing if a1 is empty. After that 1 to 20
returns 1, 2 to 40 =2 etc.
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"joemc911" wrote:

Perhaps for the more experienced this is easy. I hope so.

I want to build a sheet that scores a point value based on data entered in
one cell. I would like to score a point for any number between 1 and 20, two
points for any number between 21 and 40, etc... I imagine it's some version
of an IF formula but I can't seem to figure it out.

Any help would be appreciated. Thanks in advance!

  #5  
Old April 21st, 2010, 09:57 PM posted to microsoft.public.excel.misc
Mike H
external usenet poster
 
Posts: 8,419
Default Count based on cell value between two numbers

Glad i could help and thanks for the feedback
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"joemc911" wrote:

Perfect! Thanks Mike! I didn't really understand the lookup function but I
was able to use your formula and teach myself a little of what the lookup did
and how to use it. Exactly what I was hoping to get from here!

"Mike H" wrote:

Hi,

Try this

=IF(A1,LOOKUP(A1,{0,21,41,61},{1,2,3,4}),"")

The if(a1 bit makes it return nothing if a1 is empty. After that 1 to 20
returns 1, 2 to 40 =2 etc.
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"joemc911" wrote:

Perhaps for the more experienced this is easy. I hope so.

I want to build a sheet that scores a point value based on data entered in
one cell. I would like to score a point for any number between 1 and 20, two
points for any number between 21 and 40, etc... I imagine it's some version
of an IF formula but I can't seem to figure it out.

Any help would be appreciated. Thanks in advance!

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:55 PM.


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