Allowing 2 Forms Of Data Validation In A Single Cell - excel

Without using VBA, is it possible to have the data validation of a cell differ depending on the contents of another cell? For example, if "Yes" is entered into cell A1, then A2 is populated with a list of items. If on the other hand "No" is entered into A1, then A2 allows any value.
I can source different lists depending on the contents of the cell using the following formula as the Source in Data Validation:
=IF(A1="","",IF(A1="Yes",Sheet1!$C$1:$C$4,Sheet1!$D$1:$D$6))
However I am not sure whether this could be disabled completely if A1 is blank. Using the above formula, leaving A1 blank would not allow you to enter free text into the cell and attempting to do so would result in a data validation error.

Use the INDIRECT function. If the other cell contains a named range's name, then the dropdown will contain cells from the range.
There are forbidden characters but otherwise it works like a charm.

Related

Write N/A or " - " on empty cells if one cell of the same row is written

What I am trying to do is this;
I have a table with 8 columns.
What I am trying to do is when I write something in one of the first 4 columns in the same row the other 3 should return me with the value "N/A" or " - ", or something like that. (Or even better with an error message saying I can't write on them since one of the other is written).
The same with the other rows in the table.
Here is the table:
table
I've tried with IF(OR(ISBLACK( etc. but it wasn't working.
So if i write something on cell B3, the other cells (C3,D3,E3) will have to be empty, the same as if i write something on cell C3, the other cells(B3,D3,E3) should be empty.
You could do this using formulas, with each column have a formula that checks the other columns. For example, B3 would have:
=IF(OR(C3<>"",D3<>"",E3<>""),"Do not use","")
But the problem with formulas in data entry spaces is they get overwritten when users enter data. If the user changes their mind and deletes the value they entered, you don't get the formula back and warning won't reappear when they enter data elsewhere.
Instead, you can use conditional formatting to change the colour of cells without values after a value gets entered:
Select B1:E16 (starting from B1 is important, as relative conditional formatting depends on which cell is active within the selection)
Create a new Custom Formatting rule based on a formula: =AND(COUNTA($B3:$E3)>0,B3="")
Set the format to make the background gray
This doesn't stop users entering data in more than cell. You may want to put in another additional conditional formatting rule to set cells red if there is more than 1 value entered.

Microsoft Excel replace data from cells from a different cell

Is there a way to make the substitute function target cells that the formula isn't written in.
So an example would be cell A1 contains "A" but when cell B1 contains "A" cell A1 changes to "x"
The substitute function does this but I want to be able use the formula typed in a cell of my choosing.
No function can change a value in another cell. Functions only return values to the cell in which they reside. You need to change the cell manually or with VBA, or better yet, revise your data architecture to work with Excel, not against it.

Excel: Formulas and dropdown lists

I am trying to make a cell display the result of a VLOOKUP but allow the user to change the cells value to something from a dropdown list if they choose to.
I don't want the formula to be visible to the user.
The problem I'm having is when the user picks a different value from the list the formula is erased. When the criteria for the formula changes I want it to update to the new result.
I'm using Excel 2010. Any help is appreciated!
We can use an extra cell or two. In A3 we put a number and in A2 we can enter from a drop-down list. In A1 we have:
=IF(A2<>"",A2,VLOOKUP(A3,C1:D13,2,FALSE))
So if A2 is blank, we use the VLOOKUP(). If A2 has a value, we use that value.

Excel Data Validation Source for different columns

I am making a series of cascading dropdowns in Excel. When a user selects an option in ColumnB, the sheet finds a list "Name"d = ColumnB value and set the validation for that column with that list.
It is working fine
But when I drag the cell in the whole column and try applying the Data Validation property to all cells, instead of selecting the previous cells respectively, it is defining every Data Validation property with the specific cell with which the first cell was binded.
It is not much of a problem as I can do that for individual cell, but I will be setting the data and names through code later, so I need to find a way that every Data Validation source contains a reference to its previous cell instead of that one specific cell.
Remove the $ sign. $ sign means that the reference is absolute and the cell reference in the formulas won't change when the cell is dragged or copied.
Another solution is to define the data validation for the entire column and you don't have to drag anymore.

Excel 10 cell content validation dependant on another field

I am trying to validate the entry in a cell based on the contents of another cell in the same workbook.
For instance, A1 can contain either AAA or BBB. I am entering data in A2.
If cell A1 contains AAA, then the entry in cell A2 has to be greater than 6.
If cell A1 contains BBB, then the entry in cell A2 has to be greater than 14.
I tried to use custom validation & validation based on a formulae but I cant get either to work how I want them to.
Any ideas ?
Your custom validation formula would be:
=OR(AND(A1="BBB",A2>14),AND(A1="AAA",A2>6))
Be sure to include a helpful error message.

Resources