Solved

identifying alphanumerics in a column

Posted on 2016-11-17
6
48 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 47

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 47

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 47

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 47

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This article describes a serious pitfall that can happen when deleting shapes using VBA.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

751 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