Solved

identifying alphanumerics in a column

Posted on 2016-11-17
6
42 Views
Last Modified: 2016-11-17
I have a column that usually has 8 digit values in it.  these can be alphanumeric so a greater than function won't work.

i need to identify any cell in this column that has 9 digits or more.
any ideas?
0
Comment
Question by:jamesmetcalf74
  • 4
  • 2
6 Comments
 
LVL 11

Expert Comment

by:Missus Miss_Sellaneus
ID: 41891877
So they are alphanumeric. Do you want to identify more than 8 characters (letters and digits combined)? Or do you mean that you want to identify those that have more than 8 digits (0-9) in the alphanumeric string, regardless of its total length?
0
 
LVL 11

Expert Comment

by:Missus Miss_Sellaneus
ID: 41891879
Also, are your cells formatted General or Text?
0
 
LVL 46

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 41891883
There may well be a native Excel formula but here's a User Defined Function you can use just like a formula.

Usage:
 =HasNine(A1)
Function HasNine(cel As Range) As Boolean
Dim intChar As Integer
Dim intCount As Integer
For intChar = 1 To Len(cel.Value)
    If IsNumeric(Mid$(cel.Value, intChar, 1)) Then
        intCount = intCount + 1
    End If
Next
If intCount > 8 Then
    HasNine = True
End If
End Function

Open in new window

0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 46

Expert Comment

by:Martin Liss
ID: 41891900
If instead you want to know if the value of numbers in a cell is greater than a certain value then use this, where True is returned for values > 999,999,999.
Function GreaterThanMinimum(cel As Range) As Boolean
Const LIMIT As Double = 999999999
Dim strNumbers As String
Dim intChar As Integer

For intChar = 1 To Len(cel.Value)
    If IsNumeric(Mid$(cel.Value, intChar, 1)) Then
        strNumbers = strNumbers & Mid$(cel.Value, intChar, 1)
    End If
Next
If CDbl(strNumbers) > LIMIT Then
    GreaterThanMinimum = True
End If
End Function

Open in new window

0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 41892079
Or this version where you can specify the lower limit in the formula.
Usage for finding values > 4000:
=GreaterThanMinimum(A1,4000)

or
=GreaterThanMinimum(A1)
for finding values of 1 million or more

Function GreaterThanMinimum(cel As Range, Optional LIMIT As Double = 999999999) As Boolean
Dim strNumbers As String
Dim intChar As Integer

For intChar = 1 To Len(cel.Value)
    If IsNumeric(Mid$(cel.Value, intChar, 1)) Then
        strNumbers = strNumbers & Mid$(cel.Value, intChar, 1)
    End If
Next
If CDbl(strNumbers) > LIMIT Then
    GreaterThanMinimum = True
End If
End Function

Open in new window

0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 41892176
I'm glad I was able to help.

If you expand the “Full Biography” section of my profile you'll find links to some articles I've written that may interest you.

Marty - Microsoft MVP 2009 to 2016
              Experts Exchange MVE 2015
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2015
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question