Index & Match 2 different data sheet for multiple column in excel - excel-formula

I have two different data sheet and would like to compare multiple column. If is match then return value 1.
I have tried with formula below and seems not working..Anyone know the reason or advise the correct formula instead.
=INDEX('[Cancellation Raw Data 2023.xlsx]Sheet1'!$Y:$Y,MATCH(G2,'[Cancellation Raw Data 2023.xlsx]Sheet1'!$X:$X,0),MATCH(J2,'[Cancellation Raw Data 2023.xlsx]Sheet1'!$C:$C,0),MATCH(R2,'[Cancellation Raw Data 2023.xlsx]Sheet1'!$F:$F,0))
Attached below screenshot below for reference.
Highlighted Yellow = Matching this 3 columns
Highlighted Green = expected result if is match to show value 1 in Book1 excel sheet

If you don't have dynamic arrays then this must be entered as an array formula (using CTRL+Shift+Enter, rather than just Enter)
=INDEX('[Cancellation Raw Data 2023.xlsx]Sheet1'!$Y2:$Y10001,MATCH(G2&J2&R2,'[Cancellation Raw Data 2023.xlsx]Sheet1'!$X2:$X10001&'[Cancellation Raw Data 2023.xlsx]Sheet1'!$C2:$C10001&'[Cancellation Raw Data 2023.xlsx]Sheet1'!$F2:$F10001,0))
(it's best to avoid full-column references, so I've assumed you have just 10k rows of data - you should adjust the references for your actual number)

Related

Excel check if cell contains text from list and return values from list for every match

I have a list of products with Material no and Text description as visible in Sheet1 image.
Every part of the text has a defined value in another sheet.
How to get result in Sheet1 column C for each product based on its Text description and appropriate values defined in Sheet2?
Let's say I would like to parse the text and for each part of text to determine the value from another sheet and summarize this to one number.
For example:
Material 1 has A B C D in Text, formula should result with 100 => 10+20+30+40 (A=10+B=20+C=30+D=40)
etc...
I know I can use IF to check for each variant then return value with vlookup, but this is something I would like to avoid. Variants will change, their number can be pretty big therefore I would like to avoid changing formulas every time when we change Variants...
Looking by your screenshots you have a version of Excel prior to Micrososft365. In that case I think you can use:
Formula in C2:
=SUMPRODUCT(ISNUMBER(FIND(" "&E$2:E$11&" "," "&B2&" "))*F$2:F$11)

Index Match Formula Shows Wrong Result

I have two table, this one is the initial table that contains raw data (on Sheet 2)
And the second table (on Sheet 1) contains formula based on data from first table
I use this formula to calculate the data, but as we can see on the picture, it doesn't produce right result. Could you please help me to modify the formula?
=IFERROR(INDEX(Sheet2!$E$2:$E$12,MATCH(Sheet1!$B$1&Sheet1!B$2&Sheet1!$A3,Sheet2!$C$2:$C$12&Sheet2!$B$2:$B$12&Sheet2!$D$2:$D$12,0)),"")
First the auxiliar column, using the concatenate operator & :
Then the formula would be:
=VLOOKUP(B$2&$E$1&$A3;Sheet2!$A:$G;6;0)
Change 6 for 7 if you want the description instead of Activity.
Please try this formula. It should go into cell Sheet1!B3 where it must be confirmed with Ctl+Shift+Enter because it's an array formula. (017)
=IFERROR(INDEX(Table,MATCH(1,(INDEX(Table,,3)=$A$1)*(INDEX(Table,,2)=B$2)*(INDEX(Table,,4)=$A3),0),5),"")
In preparation of this formula to work you need to set up a named range by the name of "Table" which comprises of Sheet2!A2:Fxx. Better set this range up dynamically so that it expands as you add more data but you can also declare it as Sheet2!A2:F1000 where 1000 is a number of rows you expect never to need.
This table has 6 columns, A:F which I intentionally made to include column A, which you don't need so that range columns and sheet columns are identical. Table,,3 simply defines the 3rd column. You can replace it with Sheet2!$C$2:$C$1000. If you do, make sure that all your ranges have identical sizes.
The 5 near the end of the formula, at ,0),5),"") identifies the 5th column of the range Table from which the result is returned if the 3 criteria match. Change this number to 6 to return the result from column F or to 1 if you ever need the value from column A.

How can assigning an array formula values which referred with a Name, to the List Data-Validation?

I have write below array formula:
=INDEX(Table1[Column2],SMALL(IF(Sheet1!G6=Table1[Column1],ROW(Table1[Column1])-ROW(Table1[[#Headers],[Column1]])),ROW($A:$A)))
According this picture1:
Note that selected range contains above array formula.
I need define that array formula returned values in the list form of data validation for Column2 of right table.
What I had tried:
I defined a Name, because responsively Sheet1!G6 reference part of above formula have change in Column2 cells for its appropriated Column1 cell. (in right table), according to below picture2:
Then set Column2 of right table's data validation, (picture3 below):
The problem is
But in result, validation list only contains first result of array formula! as picture4 below:
Question
How can define an array formula valued results set to a Name (Picture 2 above) and use in List Data Validation (picture 3 above) for a Column of table ? (Picture 4 above)
My concepts are:
There where a array form formula as shown above. (On the paper and
not in a worksheets range, yet)
This array formula is corresponding to a set -collection- of (potentially returned) results.
I want use above set in the Data-Validaton List for a special Table column.
Not using helper things (as Sheet, Column, Pivot-table and Etc...)
Using (1)- Name (Ctrl + F3), (2)- the array formula (for generating valid results collection), and (3)- Data-Validation List (to check is entered value in above special Table column is valid or not valid; and let entering only valid data in that special column))
I know you said you don't want to use a helper column or sheet. But saying:
A Table and an array formula can't coexist.
Data validation source can't be a complex formula of any kind, but you can use Indirect to a named range or address (but only if its a continuous region, not multiple areas) on the source formula if you want.
An array is never returned as a whole result in array formula, each cell used on as target destiny of the calculation is an item of the returned array.
So what I would do, return the array formula in a region let's Say A1, and a counter to the number of items in your array result that are valid using another cell B1. Use a cell C1 to determine the address of the list that you want to use. Then use =INDIRECT(C1) in the source of your validation.
You can hide other sheet so another use can't see it, and if you hide it by macro you can set it to very hidden and it's not possible to make it visible from the workbook directly. You might also create a named range to the C1 cell in my example so the end user can't see where this source on validation is from.

Excel - Check if value X and value Y is on the same row

I have an excel document with two sheets, data and edu-plan. The sheet data has the following information:
The sheet edu-plan looks like this:
My question is: how do i create an excel formula that checks if the target group on the specific row in edu-plan! has the course name in question on the same row as the target group in sheet data!, i.e. if Sales and Sales course is on the same row in the sheet data!?
In reality, the data sheet as a couple of hundred rows and will change over time, so i am trying to develop a formula that i can apply easily on all rows/columns in edu-plan!.
The desired result in edu-plan would look like this:
A pivot table might be a good way to go.
If you would like to do it by formula, then you can just use a COUNTIFS
=IF(COUNTIFS(data!$A$2:$A$10,$A2,data!$B$2:$B$10,B$1),"X","")
A possible way to solve your issue with an array formula:
Write in B2 of sheet edu-plan
{=IFERROR(IF(MATCH('edu-plan'!$A2&'edu-plan'!B$1,data!$A$2:$A$6&data!$B$2:$B$6,0)>0,"x",""),"")}
Since it is an array formula, you need to hit shift + ctr + enter.
Here is the formula broken down:
MATCH('edu-plan'!$A2&'edu-plan'!B$1,data!$A$2:$A$6&data!$B$2:$B$6,0)
checks whether the combination of row header and column header is in the data table. MATCH returns the index of the found combination. Since we are not interested in the location, we only ask IF(MATCH > 0, "x", "") to write an "x" if a match was found. If MATCH finds nothing, it returns an error, which is why we add an IFERROR(VALUE, "") around the construct.

Ignoring Hidden Table Rows in Excel Formula

Good Evening.
I am trying to get my formulas to ignore hidden rows in a filtered table. I have attempted some of the tricks shown here, but I haven't been successful.
The CSV I get from BigFix (network management tool) looks something like:
The applications column lists the applications in the same cell. As a result, when I do a count function to identify the issues, I have to use a wildcard (I'm searching for the results in a different tab).
=COUNTIF('Input Data'!C:C,"*"&Results!A2&"*")
I want to be able to filter the table on the first tab, and have the formula results show up accurately on the 2nd tab.
Any ideas?
UPDATE:
I feel more information would help. The reason I want the "results" tab to update automatically is that I plan to build graphs out of the information on that tab. I would love to be able to filter the table in the 'input data' to include only Department A and have the graph autoupdate to Department A's info.
The excel files I'm working with have up to a thousand entries, and I'm trying to get graphs I can copy/paste to put into a presentation as efficiently as possible.
=SUMPRODUCT(SUBTOTAL(3,OFFSET('Input Data'!C:C,ROW('Input Data'!C:C)-MIN(ROW('Input Data'!C:C)),,1))*(ISNUMBER(SEARCH(A2,'Input Data'!C:C))))
In the above formula Restrict the C:C to your actual data range or use a named range to identify the Actual Data Range.
Edit
Above formula should be replaced with 103 instead of 3 as pointed by Jeep
=SUMPRODUCT(SUBTOTAL(103,OFFSET('Input Data'!C:C,ROW('Input Data'!C:C)-MIN(ROW('Input Data'!C:C)),,1))*(ISNUMBER(SEARCH(A2,'Input Data'!C:C))))
In the above formula Restrict the C:C to your actual data range or use a named range to identify the Actual Data Range.
Adding Explanation based on OP's Request.
In the above formula Used Sumproduct() Subtotal() Offset() Min() Row() IsNumber() Search() function combinations for arriving your expected result.
Row() - Will get the Row Number of a given range
Min() - Will get the Minimum Value of a given Numbers
Offset() - Is used to redirect the reference to each cell of a given range.
Subtotal() - Is used to find the (un)hidden state of redirected reference.
Search() - Is used to find the specific text in a given range (Not case sensitive) will result Number or error.
IsNumber() Is Used to check whether search returns Number or error. So Isnumber will return boolean True/False as result.
Column-C Column-D
Data For Filtering
a 1
b 1
a 1
a 2
a 2
The above data starts from 1st Row with headers in the 1st Row. Assume that I filtered D column With 1. Using the below formula will result 2.
=SUMPRODUCT(SUBTOTAL(103,OFFSET('Input Data'!C2:C6,ROW('Input Data'!C2:C6)-MIN(ROW('Input Data'!C2:C6)),,1))*(ISNUMBER(SEARCH("a",'Input Data'!C2:C6))))
ROW('Input Data'!C2:C6) = {2;3;4;5;6}
MIN(ROW('Input Data'!C2:C6)) = 2
ROW('Input Data'!C2:C6)-MIN(ROW('Input Data'!C2:C6)) should be read as
{2;3;4;5;6}-2 = {0;1;2;3;4}
OFFSET('Input Data'!C2:C6,ROW('Input Data'!C2:C6)-MIN(ROW('Input Data'!C2:C6)),,1) = 'Input Data'!C2,'Input Data'!C3,'Input Data'!C4,'Input Data'!C5,'Input Data'!C6
SUBTOTAL(103,OFFSET('Input Data'!C2:C6,ROW('Input Data'!C2:C6)-MIN(ROW('Input Data'!C2:C6)),,1)) should be read as
SUBTOTAL(103,'Input Data'!C2,'Input Data'!C3,'Input Data'!C4,'Input Data'!C5,'Input Data'!C6) = {1;1;1;0;0}
Subtotal() arrived the visible state of each (cell) reference.
SEARCH("a",'Input Data'!C2:C6) = {1;#VALUE!;1;1;1}
ISNUMBER(SEARCH("a",'Input Data'!C2:C6)) should be read as
ISNUMBER({1;#VALUE!;1;1;1}) = {TRUE;FALSE;TRUE;TRUE;TRUE}
SUBTOTAL(103,OFFSET('Input Data'!C2:C6,ROW('Input Data'!C2:C6)-MIN(ROW('Input Data'!C2:C6)),,1)) = {1;1;1;0;0}
(ISNUMBER(SEARCH("a",'Input Data'!C2:C6))) = {TRUE;FALSE;TRUE;TRUE;TRUE}
{1;1;1;0;0}*{TRUE;FALSE;TRUE;TRUE;TRUE} = {1;0;1;0;0}
SUMPRODUCT({1;0;1;0;0}) = 2
Used Sumproduct() to avoid Array Entry and also to do the Array Formula Task (Looping through the range of cells) and Sumproduct() will result the Sum of the passed values.
Instead of filtering the source data, use the Countifs function and add the filter conditions to the Countifs.

Resources