#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default COUNTIF

Hello

I have a question regarding counting values and cross referencing to a range
on another worksheet.

The values are IP Addresses (10.64.xxx), so I guess my first question is
whether it is possible to assign them to particular ranges.

I have two worksheets, one being the source file, with column E containing
IP addresses. The other worksheet contains IP address ranges in columns
A&B.

I am basically looking to do a count of the source file addresses and
allocate by range.

I'm currently using the COUNTIF formula below but have not had any luck:

=COUNTIF(source!$E$2:$E$9686, AND("="&A3,"<="&B3))

Any suggestions are appreciated

Regards
Tim Kuhn


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 364
Default COUNTIF

"Tim Kuhn" wrote in message
...
Hello

I have a question regarding counting values and cross referencing to a
range on another worksheet.

The values are IP Addresses (10.64.xxx), so I guess my first question is
whether it is possible to assign them to particular ranges.

I have two worksheets, one being the source file, with column E containing
IP addresses. The other worksheet contains IP address ranges in columns
A&B.

I am basically looking to do a count of the source file addresses and
allocate by range.

I'm currently using the COUNTIF formula below but have not had any luck:

=COUNTIF(source!$E$2:$E$9686, AND("="&A3,"<="&B3))

Any suggestions are appreciated

Regards
Tim Kuhn


You face two problems:
1 There cannot be more than one condition in COUNTIF.
2 The format of IP addresses (containing multiple dots) means that in Excel
they are text strings, not numbers.

The first is easily overcome by using SUMPRODUCT rather than COUNTIF:
=SUMPRODUCT(--(source!$E$2:$E$9686=A3),--(source!$E$2:$E$9686<=B3))

The second is more tricky! For example, comparison of text is done on a
character by character basis, so 2 will be seen as greater than 10. And the
fields within an IP address are not of a standard length: both 1.2.3.4 and
111.222.333.444 are valid IP addresses! If you are just working with the
last field (xxx in your example), you may be able to separate this out using
text string functions (such as LEN, FIND, SEARCH , LEFT, RIGHT, MID), and
then convert to a number with VALUE.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 287
Default COUNTIF

What values do you have in A3 and B3?

If you want to count IP addresses that start with a specific string you
could use a wildcard in COUNTIF like

=COUNTIF(source!$E$2:$E$9686,"10.64.*")

"Tim Kuhn" wrote:

Hello

I have a question regarding counting values and cross referencing to a range
on another worksheet.

The values are IP Addresses (10.64.xxx), so I guess my first question is
whether it is possible to assign them to particular ranges.

I have two worksheets, one being the source file, with column E containing
IP addresses. The other worksheet contains IP address ranges in columns
A&B.

I am basically looking to do a count of the source file addresses and
allocate by range.

I'm currently using the COUNTIF formula below but have not had any luck:

=COUNTIF(source!$E$2:$E$9686, AND("="&A3,"<="&B3))

Any suggestions are appreciated

Regards
Tim Kuhn



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
How do I use a countif function according to two other countif fu. Kirsty Excel Worksheet Functions 2 February 20th 06 11:44 AM
edit this =COUNTIF(A1:F16,"*1-2*")+COUNTIF(A1:F16,"*2-1*") sctroy Excel Discussion (Misc queries) 2 September 25th 05 04:13 AM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM
CountIF? Warren1872 Excel Discussion (Misc queries) 5 April 26th 05 02:11 AM
COUNTIF in one colum then COUNTIF in another...??? JonnieP Excel Worksheet Functions 3 February 22nd 05 02:55 PM


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