PC Review


Reply
Thread Tools Rate Thread

Combining validation types

 
 
Greg Allen
Guest
Posts: n/a
 
      29th Feb 2008
Is there a way to combine validation types on a cell?

What I would like to do is force the cell value to be either a whole number
or a selection from a list.

Is that possible?

Thanks,

-- Greg


 
Reply With Quote
 
 
 
 
Tim879
Guest
Posts: n/a
 
      1st Mar 2008
Try this...

Create a custom list somewhere in your spreadsheet for the data
validation to refer to. I did mine in cells F1:F7. For the cell that I
want to validate (a1 in my example), I used the round function to
round that cell to the nearest whole number (i.e. in cell F1, I had
the function =round(a1,0)). F2:F7 had the rest of my list.

In cell A1 in my sample sheet, I set the data validation to refer to a
list in the range F1:F7.

When I enter a decimal number in A1, the validation correctly fails
however if you enter any whole number or a number in the list, the
validation will pass. Note the validation for the decimal fails
because you are comparing the rounded (whole) number in cell F1 to the
number with decimal in cell A1. If you need to do this check over a
longer range, just add more round functions to your list.

There may be an easier way but this works and only took a few seconds
to set up.
Good luck
Tim



On Feb 29, 6:28 pm, "Greg Allen" <gregory.al...@sierraatlantic.com>
wrote:
> Is there a way to combine validation types on a cell?
>
> What I would like to do is force the cell value to be either a whole number
> or a selection from a list.
>
> Is that possible?
>
> Thanks,
>
> -- Greg


 
Reply With Quote
 
Greg Allen
Guest
Posts: n/a
 
      2nd Mar 2008
That will work for a particular cell. Thanks!

Is there a way to modify this so that I can use the same range of cells
as validation for many other cells? Say I wanted to validate every
cell of column A using F1:F7. I don't want to have to create a different
validation range for each cell I need to validate...

Thanks,

-- Greg


"Tim879" <(E-Mail Removed)> wrote in message
news:71aee93c-5b7b-42f9-88e9-(E-Mail Removed)...
> Try this...
>
> Create a custom list somewhere in your spreadsheet for the data
> validation to refer to. I did mine in cells F1:F7. For the cell that I
> want to validate (a1 in my example), I used the round function to
> round that cell to the nearest whole number (i.e. in cell F1, I had
> the function =round(a1,0)). F2:F7 had the rest of my list.
>
> In cell A1 in my sample sheet, I set the data validation to refer to a
> list in the range F1:F7.
>
> When I enter a decimal number in A1, the validation correctly fails
> however if you enter any whole number or a number in the list, the
> validation will pass. Note the validation for the decimal fails
> because you are comparing the rounded (whole) number in cell F1 to the
> number with decimal in cell A1. If you need to do this check over a
> longer range, just add more round functions to your list.
>
> There may be an easier way but this works and only took a few seconds
> to set up.
> Good luck
> Tim
>
>
>
> On Feb 29, 6:28 pm, "Greg Allen" <gregory.al...@sierraatlantic.com>
> wrote:
>> Is there a way to combine validation types on a cell?
>>
>> What I would like to do is force the cell value to be either a whole
>> number
>> or a selection from a list.
>>
>> Is that possible?
>>
>> Thanks,
>>
>> -- Greg

>



 
Reply With Quote
 
Debra Dalgleish
Guest
Posts: n/a
 
      2nd Mar 2008
This method won't create a dropdown list of choices, but will limit the
entries to those items in the list, and whole numbers:

Select the cells where you want the validation, in this example cells
A1:A100, with A1 as the active cell.
Choose Data>Validation
For Allow, select Custom
In the Formula box, enter:
=OR(COUNTIF($F$1:$F$7,A1),IF(ISNUMBER(A1),A1=INT(A1)))
Click OK

Greg Allen wrote:
> That will work for a particular cell. Thanks!
>
> Is there a way to modify this so that I can use the same range of cells
> as validation for many other cells? Say I wanted to validate every
> cell of column A using F1:F7. I don't want to have to create a different
> validation range for each cell I need to validate...
>
> Thanks,
>
> -- Greg
>
>
> "Tim879" <(E-Mail Removed)> wrote in message
> news:71aee93c-5b7b-42f9-88e9-(E-Mail Removed)...
>
>>Try this...
>>
>>Create a custom list somewhere in your spreadsheet for the data
>>validation to refer to. I did mine in cells F1:F7. For the cell that I
>>want to validate (a1 in my example), I used the round function to
>>round that cell to the nearest whole number (i.e. in cell F1, I had
>>the function =round(a1,0)). F2:F7 had the rest of my list.
>>
>>In cell A1 in my sample sheet, I set the data validation to refer to a
>>list in the range F1:F7.
>>
>>When I enter a decimal number in A1, the validation correctly fails
>>however if you enter any whole number or a number in the list, the
>>validation will pass. Note the validation for the decimal fails
>>because you are comparing the rounded (whole) number in cell F1 to the
>>number with decimal in cell A1. If you need to do this check over a
>>longer range, just add more round functions to your list.
>>
>>There may be an easier way but this works and only took a few seconds
>>to set up.
>>Good luck
>>Tim
>>
>>
>>
>>On Feb 29, 6:28 pm, "Greg Allen" <gregory.al...@sierraatlantic.com>
>>wrote:
>>
>>>Is there a way to combine validation types on a cell?
>>>
>>>What I would like to do is force the cell value to be either a whole
>>>number
>>>or a selection from a list.
>>>
>>>Is that possible?
>>>
>>>Thanks,
>>>
>>>-- Greg

>>

>
>



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

 
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
combining chart types nathanhutto Microsoft Excel Charting 1 10th Dec 2007 05:39 PM
Combining Chart types =?Utf-8?B?SmFja2ll?= Microsoft Excel Charting 1 22nd Mar 2007 01:22 AM
Re: combining different data types into memo field Van T. Dinh Microsoft Access Queries 0 15th Jan 2007 11:25 PM
Combining 2 different types of bar graph =?Utf-8?B?RGF2ZQ==?= Microsoft Excel Charting 1 23rd Feb 2006 12:36 AM
Combining Font Types =?Utf-8?B?QmlsbENQQQ==?= Microsoft Excel Misc 2 28th Dec 2004 06:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:42 PM.