Index Match With Multiple Criteria to find cell before (Excel) - excel

I am looking to do a match index with a double criteria > but i want to return the results of the cell above the results.
e.g.
Two tables
Table A is the reference point and i want to reference the Invoice Number and Product Description from Table A - find them in Table B, but i want to return the Invoice number in the above cell from table B.
if i used Invoice number 987600/Product 1 from table A as an example.
The look up would find Invoice Number 9876008, find Product 1, then return invoice numerb 608034 (As it is the one above 9876008) in table B
Thank you in advance

Use AGGREGATE:
INDEX(TABLE2!C:C,AGGREGATE(15,7,(ROW(TABLE2!$C$2:$C$100)-1)/((TABLE2!$C$2:$C$100=9876008)*(TABLE2!$F$2:$F$100="Product 1")),1))

Related

Filling the item name from rated and ranked cells (excel)

I'm trying to get Excel to fill a column with item names that have been ranked according to a rating.
Table one: column A - there are five items in their original order (A,B,C,D,E), column B - their associated ratings (75,100,100,125,100).
Table two: column A - updated ranking of the items (1,2,2,2,5) using RANK(),column B - ordered ratings of those items (125,100,100,100,75) using LARGE(). In column C I would like to list the corresponding item (names i.e., D,B,C,E,A).
I have provided a screenshot of the layout for further clarity.
I tried using IFS() function to match ratings in table one and table two, then show the item in the same row from table one, but this doesn't work when items have the same ratings (i.e., B, C and E are all 100).
[=IFS(I18=$D$18, $A$18, I18=$D$19, $A$19,I18=$D$20, $A$20,I18=$D$21,$A$21,I18=$D$22,$A$22)]
I also tried to print the address of the cell containing the matching rating in table one using CELL("address"), then use OFFSET()to print the corresponding item, but I also couldn't get that to work.
[=OFFSET(CELL("address",INDEX($D18:$D$22,MATCH($I18,$D18:$D$22,0))),0,-3))]
I'm quite new to using formulae in excel so hopefully, this will be an easy fix for someone!
Thank you so much!

EXCEL formula to count number of times each value appears in column for each unique IDs in another column

I have a table of data below in columns A & B. I would like to count the number of times a Type number appears for each ID shown in the top table D to I. I've included the answers I'm looking for in the table under it.
I know I can use =COUNTIFS(B2:B25,"="&E1) to get the count of the Types, but I don't know how to make them unique to each unique ID
You just left out the other part of the COUNTIFS.
Try: =COUNTIFS($B$2:$B$25, E$1, $A$2:$A$25, $D2)
=COUNTIFS($B$2:$B$25, IF(E$1="Blank","",E$1), $A$2:$A$25, $D2)

Calculated Fields in excel pivot

I have column ('CSAT') in a sheet that has numbers 1 and 0 in each cell. '1' represents 'Satisfied' and '0' represents 'Disatisfied'. I want to make a pivot from this sheet and have a new calculated field in it ('CSAT %') that will give me the score by dividing (Total 'Satisfied') count by (Total 'Dissatisfied + Total 'Satisfied') * 100.
I tried with COUNTIF but i dont think we can use this formula in pivot
Calculated Fields and Items in PivotTables are tricky. The main tripping point is understanding that Calculated Fields and Items operate on the totals, not on the individual values in the underlying data.
For example, if you created a new Field that was equal to Field1 * Field2 and data is being summarized by SUM, Excel doesn't multiply all of the respective values in each field and then sum the results. It first sums the fields for each category and then multiplies those results. What it's really doing is SUM(Field1) * SUM(Field2) for each category.
You can use some worksheet functions in the calculated fields, but you have to remember you're still operating on the totals. So if you created a new Field that was equal to Count(Field1) * Count(Field2), you're (almost) always just going to get an answer of 1. This is because the calculation is actually doing Count(SUM(Field1)) * Count(SUM(Field2)) for each category. The sum of each field is a single number, so the calculation is just doing 1*1 for each category.
So for this reason, you can't use aggregating functions like SUMIF or COUNTIF which need to look at each individual elements. Since you need to look at individual elements, you actually can't use a Calculated Field for your solution at all.
What you can do is use a Calculated Item!
The main catch here is you can't use any field in more than 1 location when calculated items are involved. Excel just throws an error message saying you're not allowed.
So if you have a category column as well as the CSAT column, you need to create another dummy column full of 1's to operate on.
You can then set up pivot table as follows:
Category field to Rows.
Dummy field to Data area, summarized by Sum
CSAT field to Columns
Click on the CSAT column headers in the pivot table and choose: PivotTable Tools > Fields, Items, & Sets > Calculated Item
Set Name for your new Item to CSAT%
Enter the formula: ='1'/('0'+'1')
On the CSAT field, hide items 1 and 0, so only the CSAT% field is visible
Result:
A couple of notes:
When entering fields and items in calculated fields and items, do so by placing the cursor where you want in the Formula then double clicking on the field/item name from the lists below. This will add brackets and quotes as required in the correct format.
Note that the formula doesn't need SUM around the item names, because calculated fields/items always work on the total of values. They are totalled according to how the data is summarized in the pivot table.
The dummy column was added with all values of 1 so that summing these values gives you the count, from which the percentage can be calculated using the formula specified.
Answer without using calculated fields:
Assuming you have categories in the row fields, you can put CSAT as a column field as well as a data field then choose to summarize values by Count and show values as a percentage of row totals:
After putting CSAT in column and data fields, right click on the data and select Summarize Values By > More Options...
First choose to Summarize Values By Count:
Then click Show Values As tab and select % of Row Total:
You'll then have percentage of 1's under the CSAT=1 column:

Excel PivotTable Count field as % of another Count field

I am using Excel from Microsoft Office 365 ProPlus.
Here's a really simple data table.
I want to build a Pivot Table around it to look like this...
... except that the "what I want" column (which is the count of items in Column C divided by the count of items in Column B) should be a part of the pivot table.
I have tried all sorts of things using calculated fields, calculations on fields, etc., to add the "what I want" column and just cannot make it work.
Can anyone help?
Calculated Fields only operate on the Sum of the elements in the data tables. Wherever you see a Field Name in the formula for a Calculated Field, picture it as meaning the sum of all elements for that field (that match any other row/column criteria in the Pivot Table).
Putting "= B / C" actually means "= SUM(B) / SUM(C)" for elements of columns B and C that fit that section of the Pivot Table.
The only way to achieve your goal is with two helper columns:
B Count: =COUNT([#B])
C Count: =COUNT([#C])
The sum of these columns then give you the count of columns B and C, so you can use these helper columns to give you what you want:
The Data Field based on the Calculated Field then says "Sum of What U Want", but it will always just be the result of your calculation, even if you change how the field is summarized through Value Field Settings. You can manually rename the Data Field, but it still needs to be different to the Calculated Field name you chose earlier.
Click in the Pivot Table, then go to the Analyze tab, click on Fields, Items, & Sets, then select Calculated Field. Your formula is probably
= B / C

EXCEL Find values containing

I have a list of product codes and product SKUs and need to find partial matches. The problem is all the data is out of order.
I have provided a subset of data done manually
Master SKU Product Code Corresponding Product SKU
1_100049 1000510 1_1000510
1_1000510 1000511 1_1000511
1_1000511 100052 4_100052
1_100052 1000525 N/A
1_100053 100053 2_100053
1_100054 100054 1_100054
1_1000560 1000540 N/A
1_1000570 100055 N/A
1_1000575 1000560 1_1000560
1_100060 1000570 1_1000570
1_1000600 1000575 6_1000575
1_100061 100060 3_100060
1_1000620 1000600 1_1000600
I need to find the Product SKU corresponding to the product code. Is there anyway to just list the match in column C? (The data is just in in two columns A and B)
The formula I have is
=VLOOKUP(A2,B$2:B$6000,3,"TRUE")
You can use INDEX/MATCH on a modified Master-SKU column with an array formula
=INDEX(A2:A10,MATCH(B2,RIGHT(A2:A10,LEN(B2)),0))
Use Ctrl-Shift-Enter when you insert the formula. If your columns contain numbers instead of text, you might have to add VALUE
=INDEX(A2:A10,MATCH(B2,VALUE(RIGHT(A2:A10,LEN(B2))),0))
This VLOOKUP may work for you. Adjust the lookup range to your data:
=VLOOKUP(RIGHT(A2,LEN(A2)-2),$B$2:$B$2,1,0)

Resources