If Statement that prompts user

John P

Board Regular
Joined
Oct 17, 2002
Messages
108
Hello,
I would like to write an if statement that prompts the user when the data input into a field is not within the expected range. For example, the result must be within 15% of a given number, if the user inputs a value less than 85% of the number, I want to prompt they are too low and must provide a reason...on the other hand, if they are 115% of the number, I want to prompt that they are too high and need to provide a reason. Is this possible? Any advise is appreciated.
 

Some videos you may like

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Von Pookie

MrExcel MVP
Joined
Feb 17, 2002
Messages
13,686
Yup, it's possible, but you don't need an IF statement.

Just use Data Validation, under the Data menu.
 

maxflia10

Well-known Member
Joined
May 20, 2002
Messages
890
John,

Elaborating on Kristy's contribution, in the window, there are tabs called "Error Alert" and "Input Message". The error alert lets the user input data not on you list and the input message let's you write your own error message
 

John P

Board Regular
Joined
Oct 17, 2002
Messages
108
Thank you for the prompt responses. Am I limited to the formula I can use? I plugged in >.85*ad4,<1.15*ad4 and the prompt occurs regardless of what I enter for a number.
 

maxflia10

Well-known Member
Joined
May 20, 2002
Messages
890

ADVERTISEMENT

John,

In the Allow window, select decimals and set a min and max value. If these are the only numbers that you want entered, select Stop on the error alert tab.
 

Von Pookie

MrExcel MVP
Joined
Feb 17, 2002
Messages
13,686

ADVERTISEMENT

You may also want to check out the "Custom" option under validation. You can enter formulas there, but I'm not sure how it would work for what you're trying to do.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,489
Messages
5,601,982
Members
414,489
Latest member
Xlambda

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
Top