Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Metalteck
 
Posts: n/a
Default If statements

I have a column with various numbers. I want to be able to count certain
numbers, such as 0-15,16-30, and so on.

I want to be able to write an if statetment that says if a number is between
0 and 15, count it as a 1, 16-30 counted as a 2.

Then need to perform a specific count for just 1's, 2s,....

Can you help me
  #2   Report Post  
ww
 
Posts: n/a
Default

Assuming you don't have any negative numbers you could use a countif()
=countif(A1:A100,"<=15") would return the count of numbers between 0 - 15
for numbers between 16-30 you could use
=countif(A1:A100,"<=30")-countif(A1:A100,"<=15")


"Metalteck" wrote:

I have a column with various numbers. I want to be able to count certain
numbers, such as 0-15,16-30, and so on.

I want to be able to write an if statetment that says if a number is between
0 and 15, count it as a 1, 16-30 counted as a 2.

Then need to perform a specific count for just 1's, 2s,....

Can you help me

  #3   Report Post  
Metalteck
 
Posts: n/a
Default

This works well for the first sitution, 0-15, but if i use the other; <=30,
this also counts the first condition. How do I only count for the specified
conditons without overlapping?

"ww" wrote:

Assuming you don't have any negative numbers you could use a countif()
=countif(A1:A100,"<=15") would return the count of numbers between 0 - 15
for numbers between 16-30 you could use
=countif(A1:A100,"<=30")-countif(A1:A100,"<=15")


"Metalteck" wrote:

I have a column with various numbers. I want to be able to count certain
numbers, such as 0-15,16-30, and so on.

I want to be able to write an if statetment that says if a number is between
0 and 15, count it as a 1, 16-30 counted as a 2.

Then need to perform a specific count for just 1's, 2s,....

Can you help me

  #4   Report Post  
ww
 
Posts: n/a
Default

You would have to subtract out the first condition. If you put the
<=15 formula in say cell G2. For the <=30 formula just put
=countif(A1:A100,"<=30")-G2 into cell G3. It will count all the
numbers <=30 and then subtract the amount that are <=15 so
in a sense you will just end up with numbers beween 16-30. If you then
want numbers between 31-45 in G4 you could put
=countif(A1:A100,"<=45")-sum(G2:G3)

"Metalteck" wrote:

This works well for the first sitution, 0-15, but if i use the other; <=30,
this also counts the first condition. How do I only count for the specified
conditons without overlapping?

"ww" wrote:

Assuming you don't have any negative numbers you could use a countif()
=countif(A1:A100,"<=15") would return the count of numbers between 0 - 15
for numbers between 16-30 you could use
=countif(A1:A100,"<=30")-countif(A1:A100,"<=15")


"Metalteck" wrote:

I have a column with various numbers. I want to be able to count certain
numbers, such as 0-15,16-30, and so on.

I want to be able to write an if statetment that says if a number is between
0 and 15, count it as a 1, 16-30 counted as a 2.

Then need to perform a specific count for just 1's, 2s,....

Can you help me

  #5   Report Post  
Barb R.
 
Posts: n/a
Default

Could you create another column of data for 1's and 2s from the listed data?
If so, put this in it:

=MAX(INT((A2-1)/15)+1,1)

Where A2 is the cell location of the numbers you want to count.

"Metalteck" wrote:

I have a column with various numbers. I want to be able to count certain
numbers, such as 0-15,16-30, and so on.

I want to be able to write an if statetment that says if a number is between
0 and 15, count it as a 1, 16-30 counted as a 2.

Then need to perform a specific count for just 1's, 2s,....

Can you help me



  #7   Report Post  
JulieD
 
Posts: n/a
Default

Hi Metalteck

i'm guessing this is still the same workbook i looked at the other night, if
so, adjust the formulas as follows:
AO3 : don't change
AP3 : use
=IF($Q3="","",IF(AND($U3<=(AP$1/1440),$U3(AO$1/1440)),2,0))
AQ3 : use
=IF($Q3="","",IF(AND($U3<=(AQ$1/1440),$U3(AP$1/1440)),3,0))
AR3 : use
=IF($Q3="","",IF(AND($U3<=(AR$1/1440),$U3(AQ$1/1440)),4,0))

this will put a 2 under the 30, a 3 under the 45 and a 4 under the 60
then you can use
to count the number of 1's
=COUNTIF($AO$3:$AR$2000,1)
to count the number of 2's
=COUNTIF($AO$3:$AR$2000,2)
etc

--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
....well i'm working on it anyway
"Metalteck" wrote in message
...
I have a column with various numbers. I want to be able to count certain
numbers, such as 0-15,16-30, and so on.

I want to be able to write an if statetment that says if a number is
between
0 and 15, count it as a 1, 16-30 counted as a 2.

Then need to perform a specific count for just 1's, 2s,....

Can you help me



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
Nesting more than nine IF statements in Excel Alexander Walsh via OfficeKB.com Excel Worksheet Functions 13 June 1st 05 06:31 PM
VLOOKUP + IF STATEMENTS Excel Discussion (Misc queries) 6 April 1st 05 08:43 AM
Nested IF statements John Simons Excel Worksheet Functions 14 February 16th 05 06:17 AM
4 different if statements, not working Brian Excel Worksheet Functions 5 December 12th 04 08:17 PM
If statements Mark Excel Worksheet Functions 3 November 2nd 04 08:39 PM


All times are GMT +1. The time now is 08:21 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"