I have a table of permitted combination of Dimensions, similar to the one below:
I need to have Data Validation linked to specific Dim Type (so there will be one column named A and the user should be able to select everything from Dim1 Value and Dim2 Value where the Type is A.
In a second Data Validation cell (called "B"), I need to specify the valid combinations relating to A.
So if someone selects A as 123, then in the column marked B they should be able to see only ZZZ and RQO.
I think the Data Validations can be achieved if I've got 'helper' columns, which I'm thinking is made up of FILTER() formulae, but I can't find the correct formula to list all A's in one column (regardless of whether they appear in Dim1 or Dim2), and then all B's in the adjoining one.
Note: I do not have the ability to change the data in the table itself (this will be pulled from my source material and I can't change this), but am resigned to writing VBA to sort the columns as a last resort.
Appreciate any help in solving this mess. Thanks
EXAMPLE DATA TABLE
Dim1 Type | Dim1 Value | Dim2 Type | Dim2 Value
A | 123 | B | ZZZ
A | 234 | B | ZZY
A | 345 | B | ZYX
A | 456 | B | YXW
A | 567 | B | XWU
A | 567 | B | WUT
A | 678 | B | UTS
A | 789 | B | TSR
A | 890 | B | SRQ
A | 301 | B | RQO
B | RQO | A | 123
B | SRQ | A | 234
B | TSR | A | 345
B | UTS | A | 456
B | WUT | A | 567
B | XWU | A | 567
B | YXW | A | 678
B | ZYX | A | 789
B | ZZY | A | 890
B | ZZZ | A | 301
Related
I have a list of id numbers for people that now have to have a new id. Shown below, in excel, I put the old id's and the new id's into the sheet next to each other. So old ID: 111 actually is ID: 123 and so on. I have a list of id's that need to be changed (Change This ID) and I would like the new changed ID to go into the result column. So, Instead of manually going through and changing them, is there a way to have a function do this for me? It would look at what is in the "Change This ID" column and see 444, then would go to the "Old ID" column and find 444, then go the the "New ID" column in the same row and find 101, then put that into the "Result ID" column. Then would go to the next line and do 333 and so on.
Old ID | New Id | Change This Id| Result Id| Name | Address |
-------------------------------------------
111 | 123 | 444 | 101 |
222 | 456 | 333 | 789 |
333 | 789 | 111 | 123 |
444 | 101 | ... | ... |
555 | 334 | ... | ... |
... | ... |
You can use the VLOOKUP function and write a formula to look up the New ID for the Id's that need to be changed.
A | B | C | D | E | F |
1 Old ID | New Id | Change This Id| Result Id| Name | Address |
-------------------------------------------------------------
2 111 | 123 | 444 | 101 |
3 222 | 456 | 333 | 789 |
4 333 | 789 | 111 | 123 |
5 444 | 101 | ... | ... |
6 555 | 334 | ... | ... |
... | ... |
Therefore, for the above data set, with the Row Numbers (1, 2, etc.) and the Column Names (A, B, etc.), you can write a formula in cell D1 as follows:
=VLOOKUP(C2,A:B,2,FALSE)
There are probably some Id's that did not change. To avoid getting an error for these Id's and just copy them over, you can wrap the VLOOKUP formula inside the IFERROR function (thanks to #Jeeped for the idea, see comments below), as follows:
=IFERROR(VLOOKUP(C2, A:B, 2, FALSE), C2)
Once you have the formula working in cell D1, you can use the Auto Fill feature to populate all the new Id's in Column D.
References:
VLOOKUP function on Microsoft Office Reference
IFERROR function on Microsoft Office Reference
Auto fill on Microsoft Office Reference
I need another transformation help in Excel
| A | B |
---| ----|--------|
1 | ID | Course |
2 | 1 | A1 |
3 | 1 | A2 |
4 | 2 | A1 |
5 | 3 | A2 |
I want to have a kind of group by, i.e.
| A | B | C |D | ...
---| ----|---------|---------|---------|----
1 | ID | Course1 | Course2 | Course3 | ...
2 | 1 | A1 | A2 | | ...
3 | 2 | A1 | | | ...
4 | 3 | A2 | | | ...
Any ideas? Is it possible without VBA macro?
I believe that the following link on removing duplicates from column would suit your needs (in your case you would do it horizontally).
http://www.get-digital-help.com/2009/03/30/how-to-extract-a-unique-list-and-the-duplicates-in-excel-from-one-column/
Per your reply to Robert, if you want to do it without VBA, try this... Select all cells in the first column. Copy and paste them into the first column of another worksheet. Use Excel's Remove Duplicates function on the pasted data. Then use INDEX functions in the columns to the right in order to pull the first, second, etc values matching that first column value.
With two sheets, I'm looking to compare columns B and C from Sheet1 to columns A and B of Sheet2. If there is a match, record the value in column A from Sheet1 in column C of Sheet2.
Specifically, what would be a formula to place in Column C on Sheet2 to calculate the corresponding value from Column A on Sheet1?
Sheet1
| A | B | C |
| 1 | 1000 | A |
| 2 | 2000 | B |
| 3 | 3000 | C |
| 4 | 4000 | D |
Sheet2
| A | B | C |
| 3000 | C | |
| 2000 | B | |
| 3000 | C | |
| 1000 | A | |
Sheet2 (desired output)
| A | B | C |
| 3000 | C | 3 |
| 2000 | B | 2 |
| 3000 | C | 3 |
| 1000 | A | 1 |
Apologies if this particular issue has already been answered. I feel like this should be very simple, but I'm just not very experienced in these types of lookups.
The easiest way is to insert a helper column in each sheet that defines a unique key.
To do so, insert a new column C in each sheet and populate it with this formula =A1&";"&B1.
Then, enter this formula in D1 (formerly C1) of sheet 2: =VLOOKUP(C1,Sheet1!$C:$D,2,0)
The data below is in an Excel sheet. The data is sorted on Column A (Cluster) and a group of values in Column B (Town) is associated with a Cluster. In the example below, the first five towns in Column B belong to Cluster A. Similarly, the next four towns belong to the Cluster M.
The requirement is that the first Town of each Cluster should be the same as the Cluster name itself. In the example below the first town of Cluster A is A so in Column C (Check), a 1 has been displayed. For Cluster M however, the first town is not M (it is N), hence Column C has 0 in it. Subsequently, in row 8, the cluster name matches with the town name. Hence a 1 is displayed in Column C.
How do I do this using either Excel Formulas or a macro?
+--------+---------+------+-------+
| Row No | Cluster | Town | Check |
+--------+---------+------+-------+
| 1 | A | A | 1 |
| 2 | A | B | |
| 3 | A | C | |
| 4 | A | D | |
| 5 | A | E | |
| 6 | M | N | 0 |
| 7 | M | O | |
| 8 | M | M | 1 |
| 9 | M | A | |
+--------+---------+------+-------+
With your columns labelled, in C2 and copied down to suit please try:
=IF(A2=B2,1,IF(A1<>A2,0,""))
I have a datatable which displays records of country, state and district.
country | state | district
--------+-------+---------
ABC | A | Z
ABC | A | y
ABC | A | x
ABC | B | 1
ABC | B | 2
However, as you see in the example, the country is repeated over multiple rows. I would like to merge those into a single cell like so:
country | state | district
--------+-------+---------
ABC | A | Z
| A | y
| A | x
| B | 1
| B | 2
How can I achieve this?