Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Filter cells with non-whole numbers or comment

How do filter cells so only those not a whole number (like .5, .123, .
85) or a comment returns ?
This is in the same column, but if possible would I like it to apply
to multiple columns (I think advanced filter is needed). Also if the
comment part can not be done, then the number will do.

Data
11.5
11
10
7.85
4 (has comment)

(Advanced) Filter should return
11.5
7.85
4
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default Filter cells with non-whole numbers or comment

For the non integers you can use an auxiliary column with the formula:

=MOD(A2,1)<0

You can then filter on TRUE.

I don;t know of a way to identify comments in a cell other than VBA.
You can define the following function

Function HasComment(r as Range)
HasComment = IsNull(r.comment)
End Function

You can then use another auxiliary column with the formula:

=HASCOMMENT(A2)

And again filter on TRUE/FALSE

HTH
Kostis Vezerides

On Nov 16, 1:24*pm, Kim wrote:
How do filter cells so only those not a whole number (like .5, .123, .
85) or a comment returns ?
This is in the same column, but if possible would I like it to apply
to multiple columns (I think advanced filter is needed). Also if the
comment part can not be done, then the number will do.

Data
11.5
11
10
7.85
4 (has comment)

(Advanced) Filter should return
11.5
7.85
4


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Filter cells with non-whole numbers or comment

vezerid way is not possible to use with advanced filter. Any other
ideas ?
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default Filter cells with non-whole numbers or comment

Two things:

First, I checked better and found a way to test for comment. This is
the revised and tested HasComment

Function HasComment(r As Range)
On Error Resume Next
Err.Number = 0
temp = r.Comment.Text
If Err.Number < 0 Then
HasComment = False
Else
HasComment = True
End If
End Function

Second, I tested advanced filter on a list and it worked too. Are you
sure you are using the criteria mechanism correctly? Auxiliary columns
should be placed next to the data and should also have headers. Say
you give the header Decimal to aux 1 and Comment to aux 2. Then you
need the following configuration as criteria range, in say K1:L2:

Decimal Comment
TRUE TRUE

Then you will get only cells with comments and which also have a
decimal part.

HTH
Kostis

On Nov 19, 3:39*pm, Kim wrote:
vezeridway is not possible to use with advanced filter. Any other
ideas ?


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Filter cells with non-whole numbers or comment

On Nov 19, 6:54*pm, vezerid wrote:
Two things:

First, I checked better and found a way to test for comment. This is
the revised and tested HasComment

Function HasComment(r As Range)
* On Error Resume Next
* * Err.Number = 0
* * temp = r.Comment.Text
* * If Err.Number < 0 Then
* * * * HasComment = False
* * Else
* * * * HasComment = True
* * End If
End Function

Second, I tested advanced filter on a list and it worked too. Are you
sure you are using the criteria mechanism correctly? Auxiliary columns
should be placed next to the data and should also have headers. Say
you give the header Decimal to aux 1 and Comment to aux 2. Then you
need the following configuration as criteria range, in say K1:L2:

Decimal Comment
TRUE *TRUE

Then you will get only cells with comments and which also have a
decimal part.

HTH
Kostis

On Nov 19, 3:39*pm, Kim wrote:

vezeridway is not possible to use with advanced filter. Any other
ideas ?


I tried both using the same columns with the conditions in the first
rows, and also with extra columns with the same names and rows has the
formulas. Both like ="=MOD(A2;1)<0" and "=MOD(A2;1)<0".
Using aux columns for each I want filter is a lot - I have data from A-
AI (29 columns). HasComment has never been accepted as a function in
Excel 2007 and I have allowed trust to VBA and all macros.
Placing the HasComment in the sheet or global VBA had no difference.

Using an aux column with "=MOD(A2;1)<0" and then filter on that is
the only thing I got to work.
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
EXCEL FILTER OF COMMENT CONTENT Bart Excel Discussion (Misc queries) 6 May 2nd 08 04:50 PM
Copy only visible cells after filter is applied/ sum after filter MAM Excel Worksheet Functions 0 April 9th 08 04:09 AM
How do I use advanced filter to filter for blank cells? Monique Excel Discussion (Misc queries) 2 March 21st 06 06:43 PM
Comment indicators show as numbers in HTML Bob Sweet Excel Discussion (Misc queries) 0 January 18th 06 03:58 PM
Comment position after filter cassie Excel Discussion (Misc queries) 2 June 28th 05 12:04 AM


All times are GMT +1. The time now is 04:03 AM.

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

About Us

"It's about Microsoft Excel"