Solved

identifying alphanumerics in a column

Posted on 2016-11-17
6
53 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 12

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 12

Expert Comment

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

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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 48

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 48

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 48

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

617 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