IF/IF Not Statement Assistance

Disarmonious

Board Regular
Joined
Oct 31, 2016
Messages
144
I'm trying to figure out a formula that would return a value of "?" if a certain cell was not a group of numbers. Example: I want Cell A2 to display a question mark if the user does not enter the numbers 10, 15, 20, or 25.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Are you talking about returning that value to the same cell that they are trying to enter that number into, or should the formula in A2 look at the entry in another cell (i.e. A1)?

If the later, you can use a formula like this:
Code:
=IF(OR(A1=10,A1=15,A1=20,A1=25),A1,"?")

Otherwise, if you want it to do the same cell, you will probably need to use Data Validation (but that won't put a question mark in the cell, but rather prevent certain entries), or VBA.
 
Upvote 0

Forum statistics

Threads
1,223,704
Messages
6,173,984
Members
452,540
Latest member
haasro02

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