Help about Validation number into a cell

Maurizio

Well-known Member
Joined
Oct 15, 2002
Messages
687
Office Version
  1. 2007
Platform
  1. Windows
Hi all,

how can I input into a cell a number with this limits:

1° number value from 1 to 9
2° number value from 2 to 10
but 2° number > 1° number (or 1° number < 2° number)

i.e. ok:
12 (ossia 1 and 2)
39 (ossia 3 and 9)
710 (ossia 7 and 10)
910 (ossia 9 and 10)

KO:
98 (ossia 9 and 8)
99 (ossia 9 and 9)
109 (ossia 10 and 9)

Tia. Maurizio
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
One way

Use data validation in cell B2 as follows
Allow:Custom
Formula
=AND(VALUE(LEFT(B2,1))>0,VALUE(MID(B2,2,LEN(B2-1)))>1,VALUE(MID(B2,2,LEN(B2-1)))<11,OR(VALUE(LEFT(B2,1))<VALUE(MID(B2,2,LEN(B2-1))),VALUE(MID(B2,2,LEN(B2-1)))<VALUE(LEFT(B2,1))))
 
Upvote 0
I have jst spotted that the above is has not tested everything. I will return today (out of time right now) :)
In the meantime, perhaps you can solve this yourself
 
Upvote 0
Hi Maurizio,

Does this do what you want?

Book2
AB
1Number 1Number 2
2910
Sheet1
Cells with Data Validation
CellAllowCriteria
A2Whole numberbetween 1 and 9
B2Custom=AND(B2>=2,B2<=10,B2>A2)
 
Upvote 0
=AND(VALUE(LEFT(B2,1))>0,VALUE(MID(B2,2,LEN(B2-1)))>1,VALUE(MID(B2,2,LEN(B2-1)))<11,OR(VALUE(LEFT(B2,1))<VALUE(MID(B2,2,LEN(B2-1))),VALUE(MID(B2,2,LEN(B2-1)))<VALUE(LEFT(B2,1))))

Sorry but it doesn't work fine!
 
Upvote 0
Hi Maurizio,

Does this do what you want?

Book2
AB
1Number 1Number 2
2910
Sheet1
Cells with Data Validation
CellAllowCriteria
A2Whole numberbetween 1 and 9
B2Custom=AND(B2>=2,B2<=10,B2>A2)

Hi Toadstool,
I need validation into cell "F2" without any other support cell.
 
Upvote 0
Hi Toadstool,
I need validation into cell "F2" without any other support cell.

This?

Maurizio.xlsx
ABCDEF
1Number 1Number 2
298
Sheet1
Cells with Data Validation
CellAllowCriteria
F2Custom=AND(A2>=1,A2<=9,B2>=2,B2<=10,B2>A2)
 
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,172
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top