cell validation of either set value or user input

jamesburden

New Member
Joined
Feb 6, 2009
Messages
6
Not sure if this is possible...

Can I set validation on a cell to only allow user input if a separate cell has a particular value, otherwise the cell has a default value of 1? For example, the narrative formula would therefore be something along the lines of:
If a1 = "POD" then b1="1" else user can put in whatever they like.

If possible I'd prefer to do this without using macros.

I really appreciate any advice/wisdom!
Thanks
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
How about something like this?

Cell A1: Enter whatever you like
Cell B1: Enter whatever you like
Cell C1: =IF(A1="POD", 1, B1)

That way, you can enter anything you like in cell B1, and it will show up in cell C1, unless "POD" is entered in A1, in which case C1 will be set to 1.
 
Upvote 0
Thanks MisterCrash. For various reasons I need this to be limited to two cells. Mainly because there are further calculations that come from the cell that either has a value of 1 (if a1="POD") or a user inputted value of any other number.

I guess the key question is whether it is possible within one cell to either have a set value (if conditions are met) or a user-entered value (if other conditions are met).

Any other ideas?
 
Upvote 0
What's wrong with having those other formulas reference cell C1 instead of B1? Is there really nowhere else on the spreadsheet where you can fit this formula, and have the other formulas reference that cell?

As far as I know, you can't allow both free data entry in a cell and force it to a set value under certain circumstances unless you use VBA. Once you enter something manually, it will overwrite any formula contained in the cell.

You can use data validation to prevent someone from entering a number in cell B1 if A1 is "POD". To do this, select cell B1, then go to Data | Validation, and in the Allow box, choose "Custom". Then, in the Formula box, enter this:

=NOT(AND((A1="POD"),(B1<>1)))

If "POD" is entered in cell A1, then cell B1 will not be changeable except to the value of 1. However, it won't set the value of cell B1 to 1.
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,738
Members
448,988
Latest member
BB_Unlv

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