PC Review


Reply
Thread Tools Rate Thread

Check if cell value is between two numbers

 
 
Les
Guest
Posts: n/a
 
      10th Jun 2008
Hi all,

I have a list of code numbers, 8 digits each in column A, formated as Text.

I need to do a look up to another sheet and if found bring in a department
code, but i must first check if the value per cell in column A is between

1. 10000000 and 13609999, then between
2. 00100000 and 00139999 and then lastley between
3. 00001000 and 00001399

If not then my code

Any help would be much appreciated.

--
Les
 
Reply With Quote
 
 
 
 
Gord Dibben
Guest
Posts: n/a
 
      10th Jun 2008
Les

The data is Text.

There is no "between" for text as there would be for numbers.


Gord Dibben MS Excel MVP

On Tue, 10 Jun 2008 15:16:00 -0700, Les <(E-Mail Removed)> wrote:

>Hi all,
>
>I have a list of code numbers, 8 digits each in column A, formated as Text.
>
>I need to do a look up to another sheet and if found bring in a department
>code, but i must first check if the value per cell in column A is between
>
>1. 10000000 and 13609999, then between
>2. 00100000 and 00139999 and then lastley between
>3. 00001000 and 00001399
>
>If not then my code
>
>Any help would be much appreciated.


 
Reply With Quote
 
Libby
Guest
Posts: n/a
 
      10th Jun 2008
You could perhaps use something like this?
check1 = False
Check2 = False
check3 = False
If Int(myNum) >= 10000000 And Int(myNum) <= 13609999 Then
check1 = True
ElseIf Int(myNum) >= 100000 And Int(myNum) <= 139999 Then
Check2 = True
ElseIf Int(myNum) >= 1000 And Int(myNum) <= 1399 Then
check3 = True
End If
If check1 = False And Check2 = False And check3 = False Then
'run your code
End If


"Les" wrote:

> Hi all,
>
> I have a list of code numbers, 8 digits each in column A, formated as Text.
>
> I need to do a look up to another sheet and if found bring in a department
> code, but i must first check if the value per cell in column A is between
>
> 1. 10000000 and 13609999, then between
> 2. 00100000 and 00139999 and then lastley between
> 3. 00001000 and 00001399
>
> If not then my code
>
> Any help would be much appreciated.
>
> --
> Les

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      11th Jun 2008
Well done Libby

Gord

On Tue, 10 Jun 2008 15:58:00 -0700, Libby <(E-Mail Removed)>
wrote:

>You could perhaps use something like this?
>check1 = False
>Check2 = False
>check3 = False
> If Int(myNum) >= 10000000 And Int(myNum) <= 13609999 Then
> check1 = True
> ElseIf Int(myNum) >= 100000 And Int(myNum) <= 139999 Then
> Check2 = True
> ElseIf Int(myNum) >= 1000 And Int(myNum) <= 1399 Then
> check3 = True
> End If
> If check1 = False And Check2 = False And check3 = False Then
> 'run your code
> End If
>
>
>"Les" wrote:
>
>> Hi all,
>>
>> I have a list of code numbers, 8 digits each in column A, formated as Text.
>>
>> I need to do a look up to another sheet and if found bring in a department
>> code, but i must first check if the value per cell in column A is between
>>
>> 1. 10000000 and 13609999, then between
>> 2. 00100000 and 00139999 and then lastley between
>> 3. 00001000 and 00001399
>>
>> If not then my code
>>
>> Any help would be much appreciated.
>>
>> --
>> Les


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy and move check box (check boxes) with new cell link? Marty Microsoft Excel Worksheet Functions 1 20th Jan 2010 07:43 PM
Check if Conditional Format is True or False / Check cell Color =?Utf-8?B?S2V2aW4gTWNDYXJ0bmV5?= Microsoft Excel Worksheet Functions 5 29th Jun 2007 11:12 AM
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? C-Man23 Microsoft Excel Worksheet Functions 3 19th Jan 2006 09:52 AM
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? C-Man23 Microsoft Excel Worksheet Functions 1 9th Jan 2006 01:23 PM
Check for 3 numbers in Cell before totalling Bradley Microsoft Excel Discussion 11 17th Jun 2004 07:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:27 AM.