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!
Related
I have a dataset that includes the following information:
Storage Location Tab
Column A - product identifier (can be repeated)
Column B - storage location (unique)
Quantity needed tab
Column A - product identifier
Column B - # of products needed (X)
I'm looking to use a vlookup type of equation to return the first X number (# of products needed) of storage locations results of the product identifier (as vlookup by default would only show the first result)
Well, like others have said the built in filtering is the easiest way to do this. But, if you MUST only return the first x items, you can do the following which will require a tiny change to your data:
1.) Add one additional column in your "Storage Location Tab" to keep track of the item index ( for example if it is the 3rd item with product identifier = 5 in column A, you assign it item index 3)
You can do this with the following function on C2 and just drag it down: =COUNTIFS($A$2:A2,A2).
This formula will essentially just count how many rows have the same product ID above it (including itself).
2.) Next, In your other Tab where you want to return x results, create an "item index" also. This is to for searching purposes and to keep track of the item you want to extract from the table. If you want to pull the first 4 items you essentially need to do a look up for items (1, 2, 3,& 4)
With those additional fields you can use a combination of the "index" and "match" functions to do a search on 2 criteria "Product identifier" and "Item index" to get your storage locations.
=INDEX(B:B,MATCH(1,(A:A=$F$2)*(C:C=E3),0),0)
Here is what my excel looks like to assist with a visual:
My Excel Sample
If you want to add some error checks and make it so it does not return anything for indexes greater than your "# of products needed" then you can wrap the above formula with an if statement and an if error statement. The below will return an empty space if the match returns no results or the item index is larger than the # of products needed.
=IF($G$2>=E3,IFERROR(INDEX(B:B,MATCH(1,(A:A=$F$2)*(C:C=E3),0),0),""),"")
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:
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
This is a confusing request.
I have an excel tab with a lot of data, for now I'll focus on 3 points of that data.
Team
Quarter
Task Name
In one tab I have a long list of this data displaying all the tasks for all the teams and what Quarter they will be on.
I WANT to load another tab, and take that data (from the original tab) and insert it into a non-list format. So I would have Quarters 1,2,3,4 as columns going across the screen, and Team Groups going down. I want each "task" that is labeled as Q1 to know to list in the Q1 section of that Teams "Block"
So something like this: "If Column A=TeamA,AND Quarter=Q1, then insert Task Name ... here."
Basically, if the formula = true, I want to print a list of those items within that team section of the excel document.
I'd like to be able to add/move things around at the data level, and have things automatically shift in the Display tab. I honestly have no idea where to start.
If there is never a possibility that there could be more that 1 task for a given team and quarter, then you can use a formula solution.
Given a data setup like this (in a sheet named 'Sheet1'):
And expected results like this (in a different sheet):
The formula in cell B2 and copied over and down is:
=IFERROR(INDEX(Sheet1!$C$2:$C$7,MATCH(1,INDEX((Sheet1!$A$2:$A$7=$A2)*(Sheet1!$B$2:$B$7=B$1),),0)),"")
I came across this situation. When I have to insert the values into a table from an Excel sheet I need all information in 1 Column instead of 2 multiple rows. In Excel my Data looks like:
ProductID----OrderID
9353510---- 1212259
9650934---- 1381676
9572474---- 1381677
9632365---- 1374217
9353182---- 1212260
9353182---- 1219361
9353182---- 1212815
9353513---- 1130308
9353320---- 1130288
9360957---- 1187479
9353077---- 1104558
9353077---- 1130926
9353124---- 1300853
I wanted single row for each product in shape of
(ProductID,'OrdersIDn1,OrderIDn2,.....')
For quick solution I fix it with a third column ColumnC to number the Sale of Product
=IF(A2<>A1,1,IF(A2=A1,C1+1,1))
and fourth Column D as a placeholder to concatenate with previous row value of same product:
=IF(A2=A1,D1+","&TEXT(B2,"########"),TEXT(B2,"########"))
Then Column E is the final column I required to hide/blank out duplicate row values and keep only the correct one:
=IF(A2<>A3,"("&A2&",'"&D2&"'),","")
Final Output required is only from Column E
ProductID Order Id Sno PlaceHolder Required Column
9353510 1212259 1 1212259 (9353510,'1212259'),
9650934 1381676 1 1381676 (9650934,'1381676'),
9572474 1381677 1 1381677 (9572474,'1381677'),
9632365 1374217 1 1374217 (9632365,'1374217'),
9353182 1212260 1 1212260
9353182 1219361 2 1212260,1219361
9353182 1212815 3 1212260,1219361,1212815 (9353182,'1212260,1219361,1212815'),
9353513 1130308 1 1130308 (9353513,'1130308'),
9353320 1130288 1 1130288 (9353320,'1130288'),
9360957 1187479 1 1187479 (9360957,'1187479'),
9353077 1104558 1 1104558
9353077 1130926 2 1104558,1130926 (9353077,'1104558,1130926')
You will notice that final values are only with the Maximum Number of ProductSno which I need to avoid duplication ..
In Your case Product could be Team and Order could be Quarter and Output could be
(Team,Q1,Q2,....),
Based on my understanding of your summary above, you want to put non-numerical data into a grid of teams and quarters.
The offset worksheet function will work well for this in conjunction with the match or vlookup functions. I have often done this task by doing the following steps.
In my data table, I have to concatenate the Team and quarter columns so I have a unique lookup value at the leftmost column of your table (Note: you can eventually hide this for ease of reading).
Note: You will want to name the input range for best formula management. Ideally use an Excel Table (2007 or greater) or create a dynamically named range with the offset and CountA functions working together (http://tinyurl.com/yfhfsal)
First, VLOOKUP arguments are VLOOKUP(Lookup_Value,Table_Array,Col_Index_num,[Range Lookup]) See http://tinyurl.com/22t64x7
In the first cell of your output area you would have a VLOOKUP formula that would look like this
=Vlookup(TeamName&Quarter,Input_List,Column#_Where_Tasks_Are,False)
The Lookup value should be referencing cells where you have the team names and quarter names listed down the sides and across the top. The input list is from the sheet you have the data stored. The number three represents the column number the tasks are listed in your source data, and the False tells the function it will only use an exact match in your putput.
I have been trying with little success to compare four columns containing url results to a golden list in excel.
I want to count all the matches in each column and give a running total per set. I have used VLOOKUP, Match and highlight duplicates none seem to be able to give the desired effect
Golden list Column A Column B Column C Column D
I want it to compare the values in the golden list against the other 4 columns and give a score count of all exact matches found. I have read several of the Excel Stack Overflow questions and used youtube with no luck so far.
Computing score for each item in golden list is as easy as:
=COUNTIF(range_of_all_columns, item_from_golden_list)
To get the score for each column you can either:
match each item in each column individually or
match each item in golden list against all of the columns respectively (if exact matches are sufficient)
For the second approach, you can use =IF(ISNUMBER(MATCH(...)), 1, 0) approach - if you have duplicated links in columns, or a simpler formula if they are unique:
=COUNTIF(range_of_1_column, item_from_golden_list)
..and then sum it all up for each column, as illustrated by following picture: