Excel - Find a value in an array and return the contents of the corresponding column -
I am trying to find a value within an array and then return a value to a specific row in the respective column.
In the example below, I should know what Chevrolet is in the bay:
Column A Column C Column D Column e Chevrolet Bay 1 Bay 2 Bay 3 Toyota Ford Saturn Honda Chevrolet Jaguar Ferrari Subaru Lexus Mitsubishi Hyundai BMW I'm writing Chevrolet in C2: E5 once it determines that the Chevrolet is in Column D, So I need to return the value in D1 for this. If this column was in E, I need it to return the value in E1.
Any help would be greatly appreciated. Thank you very much in advance.
Try it array formula : < Code> = INDEX ($ C $ 1: $ E $ 5,1, SMALL (IF (no (ISERROR (SEARCH (A1, $ C $ 1: $ E $ 5)), column ($ A: $ C) , 99 ^ 99), 1))
Or if you are certain that the search is actually being found in each column, then it can be written as:
= Index ($ C $ 1: $ E $ 5.1, small (if ($ C $ 1: $ E $ 5 = A1, column ($ one: $ C), 99 ^ 99), 1)) < Enter the formula in any cell by pressing / code> Ctrl + Shitf + . How does this work? Our last goal is to find the match - First we match using this formula to find:
SEARCH (A1, $ C $ 1: $ E $ 5) . It just checks whether any of the entries matches A1 , in fact, it can be simplified in $ C $ 1: $ E $ 5 = A1 , But I'm not sure that in all the entries in each column exactly matches A1 . - When this formula is entered as array formula , the array of values will produce something like this:
{SEARCH (A1 , C1), Search (A1, D1), Search (A1, E1); ... search (A1, E5)} . The result would be the number of numbers (numbers) and errors (if non was found). But we do not want that, we will be returning the error every time. - Then we use
IF (NOT (ISERROR (SEARCH (A1, $ C $ 1: $ E $ 5)), column ($ one: $ C), 99 ^ 99 This formula gives column number if a match occurs and a relatively large number of 99 ^ 99 otherwise the result will be: {99 ^ 99, 99 ^ 99, 99 ^ 99, 2, ..., 99 ^ 99} . - Because we already have columns and huge numbers There is an array we just use
SMALL to return a small number, which is the least in my opinion The match number where the match is found. Small (IF (No (ISERROR (SEARCH (A1, $ C $ 1: $ E $ 5)), column ($ A: $ C), 99 ^ 99), 1) 2 Which column will return where Chevrolet is referred to as $ C $ 1: $ E $ 1 . < / Li> - Since we already have the column number, the Em> index function is:
INDEX ($ C $ 1: $ E $ 5,1,2) . Note: 99 ^ 99 can be a relatively large number not necessarily 99 ^ 99 . The actual 16385 (Maximum column count in Excel 2007 and maximum + 1) can be used. Result:
Comments
Post a Comment