I am trying to figure out how to have Excel take a column of text from one table and reference another table as an index of what value to enter back into the first table. Example:
Table 1:
Greg__Blue__5
Cindy_Green_3
Table 2:
Green__ 3
Blue____5
I want to populate the third column with the number that lives in Table 2. So that I will have table two act more like an index as data changed in Table 1.
Maybe:
=VLOOKUP([#Colour],Table2[#All],2,0)
Related
I have a list of keys that I want to return another key if another column matches that key and is greater than one. Then it will return the key if that same other column is equal to 1. I will attempt to explain this better with visuals below. I would appreciate any assistance or at least how I would go about doing this.
What I am Starting With:
What I would like to end with:
Use INDEX/AGGREGATE:
=IFERROR(INDEX($B:$B,AGGREGATE(15,7,ROW($A$2:$A$9)/($A$2:$A$9=$E2),COLUMN(A1))),"")
Put that in the first cell and copy over as far as desired and down the unique list:
If one has Office 365 Excel then put this in the first cell and drag down the unique list and it will spill to the right as needed:
=TRANSPOSE(FILTER(B:B,A:A=E2,""))
You can use a pivot table and put Key1 in the rows and Key 2 in the columns. Then you can drag the Quantity fields into the filter and make sure you only get the columns = 1.
Finally, if you want to initial Key for the quantity that is > 1 you could either use a second pivot or you order die initial table descending by quantity and use index match or vlookup to return the first match (which if ordered correctly will be the key for the quantity > 1).
I have a problem when trying to do index matching. I want to match the item from table 1 and table 2 to obtain the Sample field. If Item from table 1 is matched with table 2 Item and the Lot size from table 1 is in between table 2 LotSizeFrom and LotSizeTo. It will obtain the Sample field from table 2.
table 1
table 2
Expected Output
try the following formula. You will need to sort your data by item ascending and then by lot size from, also ascending. The column Lotsize to is not required. See the screenshot for the cell references.
=INDEX(INDEX($D$1:$D$19,MATCH(H2,$A$1:$A$19,0)):INDEX($D$1:$D$19,MATCH(H2,$A$1:$A$19,1)),MATCH(G2,INDEX($B$1:$B$19,MATCH(H2,$A$1:$A$19,0)):INDEX($B$1:$B$19,MATCH(H2,$A$1:$A$19,1)),1))
INDEX() combined with SUMPRODUCT() should work :
=INDEX($I$2:$I$18,SUMPRODUCT(ROW($F$2:$F$18)-1,($F$2:$F$18=B7)*(A7>=$G$2:$G$18)*(A7<$H$2:$H$18)))
I have a database table that is structured like this
SAP Number, FOW, WD, DG
In a different sheet I am using data from this list
It looks like this
SAP Number, WD, DG, ....
The SAP Number is given, WD and DG are searched using VLOOKUP
=VLOOKUP($A2,Objektive!$B:$M,10,FALSE)
This however is difficult to read and could be solved much easier.
I know that the search value is in $A2, and I know that the value is in a tabular named "WD".
Is it possible within Excel to search for the Row similar ot VLOOKUP, but use the column using the column name as [#[WD]]
Here some peudo-code
=VLOOKUPTABLE($A2,Data[#[WD]],FALSE)
If your data table starts from the first column, you can use the COLUMN function to determine the index of the column you want to return data from in the table using the name of that column.
=VLOOKUP($A2,Data,COLUMN(Data[WD]),FALSE)
Alternatively you can use Index/Match to directly reference the columns you want to match and return data from.
=INDEX(Data[WD], MATCH($A2, Data[SAP Number], 0))
If you create a table from the Excel (select any of the cells and press Ctrl + T) you gain access to named references which you can use in Excel formulas. Just make sure your data contains headers.
I have a table A that contains ID (i.e. SR1000). Also a table B with two rows, another ID (i.e. C-1) and text on the second row.
I was trying to use VLOOKUP using the ID on table A to return ID on Table B if ID from Table A is somewhere in the text of column 2 in table B.
Table A
SR1000
SR1001
Table B
C-1|dummy text
C-2|dummy SR1000 dummy
So it should return C-2 when looking for SR1000.
Is VBA my only option? Trying to avoid reinventing the wheel.
It seems the formula:
=INDEX(F:F,MATCH("*"&B4&"*",G:G,0))
has been deemed fit for purpose and by way of explanation this was based on assumed locations as below:
Data I have:
ID IMAGE
-- ------
1 1.JPG
1 5.JPG
1 12.JPG
1 4.JPG
2 9.JPG
2 41.JPG
2 4.JPG
Required Result:
ID IMAGE 1 IMAGE 2 IMAGE 3 IMAGE 4
-- ------- ------- ------- -------
1 1.JPG 5.JPG 12.JPG 4.JPG
2 9.JPG 41.JPG 4.JPG
Formula I used in column C:
="IMAGE "&COUNTIF(A2:A8,A2)&"-"&A2
It is important that A2:A8 covers the full range of the data (doesn't matter if it is bigger than the data range). This basically creates a unique key for each image/ID pair that can be referenced in the table in F2:M3 (the note beneath the table erroneously states G2:M3 - typo on my part!) When you fill this down column C it will count all subsequent instance of the ID and alter the lookup key accordingly.
Column D just repeats the image name from your data in column B
I've created a named range that covers C1:D8 (this should cover the full length of the data columns that you have, define named range under 'Formulas' in Excel 2010 - select the range and give it a name I've called mine ID_IMAGE_LOOKUP.
I copied the ID column and used Excel's 'Remove Duplicates' feature from the Data tab to just leave unique IDs and then listed IMAGE 1...7 across the top row.
Now I'm ready to create a formula in cell F2 that references the unique ID column in E2:E3 and the image# number header row F1:L1 as follows:
=IFERROR(VLOOKUP(F$1&"-"&$E2,ID_IMAGE_LOOKUP,2,FALSE),"")
Note the $ signs to fix the column reference on E and row reference on 1, when I copy/paste/drag the formula to fill all of the boxes in the table the formula will always refer to the header row and ID column
I've assumed that you aren't fussed about what order the images are listed in as this will give a reverse list (see the first image for ID is 4.jpg). If this is a problem it would be a little more complicated but this approach could be adjusted to suit, something like take the current count for the ID away from the MAXIF() of the ID counts? Might need two count columns to avoid circular reference?
Comment if you get stuck/this doesn't make sense
Apologies for delay getting back to you, longer day than I'd anticipated!