Excel 10 cell content validation dependant on another field - excel

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.

Related

Create a user form in Excel that uses formulas

I have a simple excel file containing 2 tabs (Sheet1 and Sheet 2). Sheet 1 contains a list with multiple columns: file number (A), name (B), address(C), first_call (D), date/time of first call (E), second call (F), date/time of second call (G). Sheet2 is basically a form containing the same fields, built as follows:
A1 - file number (entered manually)
A2 - uses VLOOKUP to display name associated with the file number on A1
A3 - uses VLOOKUP to display address associated with the file number on A1
A4 - drop down list containing several items (for instance, wrong number, not interested etc.)
A5 - time stamp, based on value in A4 (if an option is selected, A5 will show the date and time of selection and cannot be modified)
A6 - same as A4
A7 - same as A5
(In reality, the list is much larger, with more columns)
Now, admitting I enter a file number in A1. Information in A2 and A3 will be automatically displayed. I then select the result of the first phone call in A4. I want that selection (and the corresponding time stamp) to be carried to Sheet1, column D in the same line as the file number. This information should be permanent (like, if I enter the same file number again in Sheet2!A1, cell A4 should display the information previously entered). My only option at this point is to make another selection in Sheet2!A6.
I know how to create a user form, but the problem is that almost every cell in Sheet1 contains a formula. As a result, a simple user form is not an option.
Basically, I want my "form" in Sheet2 to be able to read from Sheet 1 or write to Sheet1 if the cell is blank. It's a 2-way form. If a cell in the list contains data, it will be displayed (read only). If not, it lets you update it.
I have also tried to use a 3rd sheet to kind of create a loop but it doesn't work.
I don't want somebody to do the work for me. I just want to know if this can be done with formulas (since my VBA knowledge is very, I mean very limited). Any help in this matter is greatly appreciated!

How do i add a formula to a cell from a different cell?

The user enters any value in cell B3, this then makes the title Property 1 appear in B2. I need it to also populate the C2 field with the same formula and so on.
I have a formula in cell B2, which is basically; If cell B3 has information in it, B2 will populate with Property 1. I then need to apply that same formula to the next cell in the sequence - C2, with Property 2, so on and so forth.
=IF(NOT(ISBLANK(B3)),"Property "&COLUMN()-1,"")
The formula itself works very well, I have put it into all of the row 2 fields. The issue is that Excel prints pages with formulas. I've tried finding a way to stop printing the pages with only formulas, but there doesn't appear to be such a thing. As I don't know how many pages will be used, the formula needs to be clever enough to stop if the row 3 field is not populated.

How to Apply Conditional Format to show a field is mandatory to be filled in based on a vlookup to another sheet

I'm trying to create a form in excel for my team to fill out which highlights certain cells in a row as compulsory (format the cell colour) based on the number from a table in another sheet which has 3 preset dimensions ("M"=Mandatory, "P"=Prohibited, "O"=Optional) for each number across multiple analysis field.
I have tried conditional formatting formulas to highlight the cell to fill out if the lookup of the number chosen returns "M") but I don't seem to have a formula which validated this and returns with the cell highlighted when it needs to completed.
I would like the formula to return the cell as highlighted if it is mandatory based on the lookup to the table and need the user to fill out the cell with the information relevant.
Any help would be much appreciated.
If I understand your question correctly you just want the cell to highlight when its sister cell in another sheet is coded "M". That's a fairly easy formula.
=Sheet2!$B1="M"
This is for a straight column in B, where the cell it's checking against is in sheet 2 and also in column B. If it's for a row simply move the $ to say b$1.
If you want the highlight to disappear when the cell is filled in use this formula:
=AND($B1=0,Sheet2!$B1="M")

Allowing 2 Forms Of Data Validation In A Single Cell

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.

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.

Resources