Conditional input

Zubair

Active Member
Joined
Jul 4, 2009
Messages
304
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I need restriction (Pop up message) while the user puts more quantity in cell B2 vs E2.

ProductQuantity RequiredProductQuantity available
Apple
8​
Apple
2​
BananaBanana
4​
OrangeOrange
3​
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
setup a DATA validation with a formula
$B2<=$E2
and then you can put a message in the pop if you want

Book13
ABCDE
1ProductQuantity RequiredProductQuantity available
2Apple2Apple2
3BananaBanana4
4OrangeOrange3
Sheet5
Cells with Data Validation
CellAllowCriteria
B2:B4Custom=$B2<=$E2



 

Attachments

  • 1 - 1 (3).jpeg
    1 - 1 (3).jpeg
    35.5 KB · Views: 6
Upvote 0
Hi etaf, its giving an error

This value doesn't match the data validation restrictions defined for this cell.
 
Upvote 0
thats what you should have if the value in B entered is greater than value in E
did you use
=$B2<=$E2

I have saved to a share , but will only be on the share for a few days
I dont think XL2BB retains the data validation if copied into a spreadsheet

so you can open and see it working

 
Upvote 0
DataVal-ETAF.xlsx
ABCDE
1ProductQuantity RequiredProductQuantity available
2Apple2Apple2
3Apple3Banana4
4OrangeOrange3
5
Sheet5
Cells with Data Validation
CellAllowCriteria
B2:B4Custom=$B2<=$E2


How can we restrict if the user puts again the same product with quantity 3 in cell B3 as if the available quantity in E2 already consumed with the selection of B2?
 
Upvote 0
need to compare the total required with the total available
a few ways to do that , I choose SUMIF()

=SUMIF($A$2:$A$10,A2,$B$2:$B$10)<=SUMIF($D$2:$D$10,A2,$E$2:$E$10)
Enter that into the Data Validation

In case in the Quantity available there happens to be more than one entry
Otherwise you would maybe use a lookup for quantity available, if there is only one - but a sumif() is just as easy

heres the xl2bb and also i updated the share

DataVal-ETAF.xlsx
ABCDE
1ProductQuantity RequiredProductQuantity available
2Apple6Apple8
3appleBanana4
4Orange1Orange3
5Orange2
6Orange
Sheet5
Cells with Data Validation
CellAllowCriteria
B2:B6Custom=SUMIF($A$2:$A$10,A2,$B$2:$B$10)<=SUMIF($D$2:$D$10,A2,$E$2:$E$10)


 
Upvote 0
Solution

Forum statistics

Threads
1,215,053
Messages
6,122,882
Members
449,097
Latest member
dbomb1414

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