ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I filter for items that end in % (https://www.excelbanter.com/excel-discussion-misc-queries/75798-how-do-i-filter-items-end-%25.html)

Janet M.

How do I filter for items that end in %
 
I have a listing of $values, %values and plain numbers. I want to filter
only for the values ending with %.

Gary''s Student

How do I filter for items that end in %
 
let's say you have a list of values in column A:
label
1
10
$10.25
34%

and you want to show only the % values. First enter this UDF:


Function perzent(R As Range) As Boolean
' gsnu
Dim s As String
s = R.NumberFormat
If Right(s, 1) = "%" Then
perzent = True
Else
perzent = False
End If
End Function


Then in B1 ente and label cell and in B2 enter:
=perzent(A2) and copy down

Only the % values will show TRUE. Pull down Filter Autofilter and select
TRUE from the filter pull-down.
--
Gary''s Student


"Janet M." wrote:

I have a listing of $values, %values and plain numbers. I want to filter
only for the values ending with %.



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com