Solved

identifying alphanumerics in a column

Posted on 2016-11-17
6
18 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
Comment Utility
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
Comment Utility
Also, are your cells formatted General or Text?
0
 
LVL 45

Accepted Solution

by:
Martin Liss earned 500 total points
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
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 45

Expert Comment

by:Martin Liss
Comment Utility
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 45

Expert Comment

by:Martin Liss
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now