Adding Multiple Name Lists to Conditional Dropdown in Excel - excel

I'm creating a spreadsheet that has dropdowns that have content based on more than one cell, and add different things according to those conditions. I've been searching for the past hour trying to find something online (here, Google, etc), and either I haven't been searching for the right thing, or no one's thought to try it before, but either way, here we go:
The point is that, in Data Validation, the references for named groups seem to be only singular, but I want to be able to add multiple named groups to a single drop-down list depending on what's available. For instance, one drop down box (D1) can have values based on two cells (A1, A2), and both are dropdowns themselves. If A1 and A2 both say that something should show in D1's list, I want both to show up (in an order specified by the order in which I check the cells). Is this even possible with Excel, and if so, how the heck do I do it?

Wow man this was really a challenge I enjoyed this one quite a bit! Sorry the first answer was not what you needed but this should do!
So first I set up my sheet as follows:
I then added the True and False conditions for Choice 1 & 2 using data validation
I then input formulas in Column H to create a new list based on the choices
=IF($A$2=TRUE,E2,"")
=IF($A$2=TRUE,E3,"")
=IF($A$2=TRUE,E4,"")
=IF($A$2=TRUE,E5,"")
=IF($A$2=TRUE,E6,"")
=IF($B$2=TRUE,F2,"")
=IF($B$2=TRUE,F3,"")
=IF($B$2=TRUE,F4,"")
=IF($B$2=TRUE,F5,"")
=IF($B$2=TRUE,F6,"")
So for the first 5 formulas if the choice is A2 is True then it will display the appropriate item from List 1 into the Dynamic List.
For the last 5 formulas if the choice is B2 is True then it will display the appropriate item from List 2 into the Dynamic List
For Example:
If A2 = True & B2 = False
If A2 = False & B2 = True
At this point I realized that the spaces in the dynamic list would be a problem so I had to create an ARRAY to remove the spaces. There are tons of examples online to do this but this was the simplest formula. (I can't explain ARRAY formulas I use them every once in awhile but don't fully understand them I am sorry about that)
In I2 I placed the following ARRAY formula (The cell above I2 must remain blank)
=INDEX($H$2:$H$11, MATCH(0, IF(ISBLANK($H$2:$H$11), 1, COUNTIF(I1:$I$1, $H$2:$H$11)), 0))
You then must press CTRL + SHIFT + ENTER after inputting the formula to make it an array formula
Then drag the formula down to I11 using autofill
Then in C2 I created a dynamic drop down using data validation and an OFFSET Formula to refer to the valid text items contained in the indexed list (The OFFSET formula is is explained here http://www.ozgrid.com/Excel/DynamicRanges.htm)
The formula is:
=OFFSET($I$2,0,0,MATCH("*",$I$2:$I$11,-1),1)
The OFFSET Formula is used in the source field of the Data Validation for C2
Now your list in C2 is dynamic based on the Choices in A2 and B2
For example:
A2 and B2 = False
A2 = True and B2 = False
A2 = True and B2 = True
A2 = False and B2 = True
There might be another way to do this with VBA (I am not that great with it) as well but for now this should do! Hope this solves your issue!

It is possible I was able to do this:
I made list of items in column D and E in this instance:
Column D contains the letters A,B,C,D
Column E contains E,G,H,I
The values can be what ever you need it to be.
I then made a drop down list in cell B1 using Data Validation -> List referencing the list in column D
I then made a drop down list in cell C1 using Data Validation -> List referencing the list in column E
I Then made a drop down list in cell A1 using Data Validation -> List referencing the drop down lists that are in B1 and C1
This dynamically changes drop down list in A1 based on the selected values in B1 and C1
In the image below I selected B and H which changed the list in cell A1 to have the options B and H.

Related

Where text in one cell matches text another cell populate the value in the adjacent cell

I am trying to create a formula that when I paste text into D2:D11, the adjacent cell (E2:E11) contains a formula that checks cells J2:J7. If the text in D2 matches any data in J2:J7, it populates the number contained in the adjacent cell I2:I7 into the corresponding cell E2:E11.
For example where D1 = Glasgow FC, it checks J2:J7 matches with J4 and populates the figure at I4 (3) into E2 when the formula is copied into the other E cells it will also populate I4 (3) into E5 and E8.
Hope this makes sense
You haven't specified if the order of the Organisation is tied to the Service ID. Here's a solution where the second organisation has Service ID = 2 etc.
The Formula
=MATCH(D2;$J$2:$J$7;0)
Explanation
Place this formula in the E2 like in your picture
D2 is the first row of Employers
J2:J7 is the list of organisations
What you may realize is that you will have to adjust this J2:J7 if you expand on the list. I would highly suggest making a new Table with these organisations. Then, we can just reference TableOrgs[Organisation] and it will work regardless of how many rows you have.
Another little detail that you might see, is that Reading Borough Council will result in a #N/A error. This is because it could not be found in the list. You could use =IFERROR(theFormulaHere; "") to display nothing if it was not found.
Best of luck! ^_^

Check if values in a list exisiting in another list

I want to check if the list in Column A contains only products from the list in Column B.
If yes in Cell D1 the value = yes
If not in Cell D1 the value = no
As cou can see in the example above Product C and Product E do not exist in the list in Column B, therefore the value in Cell D1 is no.
So far I was able to figure out this formula =IF(ISNA(VLOOKUP(A1;$B$1:$B$5;1;0));"No";"Yes").
However, I would have to add a helper column with this formula to each row next to Column A.
Is there a solution that solves the issue with one formula in in Cell D1?
A basic formula might be
=SUMPRODUCT(COUNTIF(A1:A10,B1:B10))=COUNTA(A1:A10)
or more dynamic
=SUMPRODUCT(COUNTIF(A:A,B1:INDEX(B:B,COUNTA(B:B))))=COUNTA(A:A)
These can be wrapped in an if statement to give "yes" or "no":
=IF(SUMPRODUCT(COUNTIF(A1:A10,B1:B10))=COUNTA(A1:A10),"yes","no")
=IF(SUMPRODUCT(COUNTIF(A:A,B1:INDEX(B:B,COUNTA(B:B))))=COUNTA(A:A),"yes","no")

MS Excel: Duplicate a cell in the same sheet, if the cell contains text

I am running into an issue in Excel when trying to create an automated spreadsheet. I have most of the data ready to go already, but this one thing is giving me some serious trouble.
I am trying to create a data tracking file. Most data will be entered manually, in which I will have certain data to be tracked (column A) and criteria to track that data for (row 1). The data to be tracked will always be the same, but the criteria will be changed depending on the needed numbers. The same sheet will contain multiple sets of this one table to track the same data over different time periods.
I would like to make entering the criteria for all tables easier, by having Excel automatically copy the contents of row 1 into the header rows of the other tables if data is present in row 1. If a cell is blank in row 1, I would like the corresponding cells in the other tables to also be blank.
I thought there was a way to do that, but I can't remember how. Also, I would like to achieve this without using macros.
I have been searching here and elsewhere online, but all I could find were ways to display pre-determined text or values, if a cell contains specific text, i.e. "if cell x contains apple, return TRUE in cell y" or "if cell x contains apple, sum value of cell y in cell z".
Example:
IF B1 =/= empty THEN B14=B1; IF B1=empty THEN B14=empty
Right now the only option I found was the formula =B1 in B14, but that returns a 0 if B1 does not contain anything, I would like to have B14 empty though in that case.
Is what I am trying to do at all possible, or am I remembering this wrong?
Any help would be really appreciated.
Try the following formula in cell B14:
=IF(B1<>"",B14,"")
The "" in the formula represents blank while <> represents 'is not equal to'. So IF B1 'is not equal to blank', THEN return B14. Otherwise (IF B1 'is equal to blank'), return blank.
You can as well reverse the TRUE/FALSE values of the IF by using:
=IF(B1="","",B14)

Formula to compare two values in Columns in Excel

I am attempting to compare the numerical value in one column with that in another. Then have another column populated depending on the results. I do not know how to write this due to limited experience with Excel. This is what I am attempting to do:
If B1 < C1 then D1 = C1
If B1 > C1 then D1 = B1
You should put your logic(formula) in the cell you want to give a custom behavior.
As I can see you want to put a dynamic value into column D cells (D1).
So, you should put a formula in cell D1 to behave as you want:
=IF(B1<C1,C1,B1) (sometimes you have to use ; instead of , depending on language)
It says:
If b1<c1 then put C1 into this cell otherwise B1
=IF( Logic, Case-true, Case-False )
In excel the IF operator receives 3 inputs separated by ; sign:
The logic condition in the first option
the result you want to use if condition is true
the result you want to use if condition is false
To use this formula in all lines of column D, just press the black little square in the right corner bottom of the cell and grab it until the line you want

How to look up value in a column, and assign specific entries

I have a sheet in Excel where the columns contain different names of people that are in different teams in my department (i.e. Names in Column 1 are in Team 1).
For another sheet, I need to have a formula that achieves the following:If I write a name in Cell B2 that can be found in the first column of that other sheet (Team 1), Excel should populate cell B6 with "Team 1".
If instead, the name I wrote is found in the second column, then the text should read "Team 2".
I've tried a couple of different formulas w/o success, and stringing a lot of IF and OR functions together is way too cumbersome. Anybody has a better solution?
If you need this formula for more then only two column then id use the formula
=INDEX(Sheet1!C1:G1,SUMPRODUCT((Sheet1!C2:G6=B1)*COLUMN(Sheet1!C2:G6)))
Say you have a set-up like:
And in B1 of Sheet2 you enter Name3, you want it to return TEAM1 as shown below:
The only catch to this formula is that you will need to tell it how many columns are before your data so if you have a table more like:
Then you need to tell the formula that there are 2 rows before your data starts, your new formula will be
=INDEX(Sheet1!C1:G1,SUMPRODUCT((Sheet1!C2:G6=B1)*COLUMN(Sheet1!C2:G6))-2)
Notice the -2 before the last parenthesis this is to indicate that there are 2 columns BEFORE you data.
and the new result for looking up say NAME20 would become as follows:
*EXPLANATION: *
The formula works as follows , I will do it all on one page for easier viewing and instead of Sheet2!B2 and B6 I will use G2, and G6 on the same sheet as the data.
First we look at all values in the Range A1:E6 and find the one with the matching name so we use
=A1:E6=G2
Now when you enter this into the cell you will recieve a #VALUE,but if you goto the Formula Bar and press F9 it will shwo you the full value of the formula
{FALSE,FALSE,FALSE,FALSE,FALSE;FALSE,FALSE,FALSE,FALSE,FALSE;FALSE,FALSE,FALSE,FALSE,FALSE;FALSE,FALSE,TRUE,FALSE,FALSE;FALSE,FALSE,FALSE,FALSE,FALSE;FALSE,FALSE,FALSE,FALSE,FALSE}
In this we know that one cell contains the Name we searched for, this is represented by the TRUE
Now when using a formula like SUMPRODUCT, FALSE = 0 and TRUE = 1
So to get the column we mutiply every result by the column they are in.
=SUMPRODUCT((A1:E6=G2)*COLUMN(A1:E6))
So any cells that don't =G2 are FAlSE or 0, and when you multiply the column of that cell by 0 (because false = 0) it will simply result in 0. But for the one cell that IS TRUE or 1 When you multiply the column of that cell by 1 (because TRUE = 1) The product will be the cells column number
So as shown in the picture when looking for NAME13 the result of the sumproduct is 3 (its column)
Then to return the TEAM for that name, we use the INDEX function will return the value in a cell at the given cordinates.
In this case we want the value from A1:E1 that is in the same column as the Name we matched. When looked at as an Array A1:E1 looks like
{"TEAM1","TEAM2","TEAM3","TEAM4","TEAM5"}
And we want to return the value in that array at the same position as the column number of our cell, Minus any nonincluded column before the data, thus the reason for the -2 in the secon example I gave you.
So:
=INDEX(A1:E1,SUMPRODUCT((A1:E6=G2)*COLUMN(A1:E6)))
In this example excel interprets this formula as
Return the 3rd value (the 3 comes from the sumproduct as explained earlier) in the list of value from A1:E1. And that value would be TEAM3.
use a MATCH() or VLOOKUP() function inside an IF(). SOmthing like:
IF(NOT(ISERROR(MATCH(...)));"Team1";"")
Did you know you can browse functions by catergoty (such as Search), just clikc the fx left of your formula bar and use the drop down box. Each formula comes with a description with usually rather clear information...

Resources