Count Max Values of Top 1,2,3 on another workbook - excel

I've trying to come up with a formula to automatically populate top 1,2,3 text occurrences from another Workbook, however I have multiple criterias that seem to be making it more difficult for me.
So in Workbook 1, I have:
Column A
Dates ranging from 2106-Present
Column B
Random PartNumbers with a mix or numbers and letters
(Note partnumbers are not a definite list as they change and new one implemented)
Column C
Location
This list has over 10k records
I'm creating a separate workbook (template)
Column/Row A1 Top part Number 1
Column/Row A2 Top part Number 2
Column/Row A3 Top part Number 3
Formula has to have a condition for month range and location
Column B1 would display the part number (1st place)
Column C2 would display the count
And so on...
For example:
Template would display:
Top Part Number | Part Number | Count
1 | P23 | 23
2 | 345 | 19
3 | D43 | 16
(Count is determined by month and location of choice)
Any help would be appreciated

Related

Excel function for comparing columns with repeated values

I'm using excel and have two columns (A & B) with values
I want to search for each value in Column A and return the position in Column B.
I'm using this formula:
IFERROR(MATCH("Values in Column A";"Array = Column B";0);0)
The results are:
Column A | Column B | Column C
1 | 4 | 2
2 | 1 | 3
3 | 2 | 4
4 | 1 | 1
1 | 2 | 2
| 3 |
It works fine if it doesn't encounter repeated values. However, I want it to encounter repeated values, so the formula should ignore the ones it was encountered before and go through the others. So the correct result should look like this:
Column C
2
3
5
1
4
Can you help me on this? Is there a VBA routine for this?
From the article Getting the 2nd matching value from a list using VLOOKUP formula, you can create a helper column to affix the instance number of each value, to create unique id's.
For example, in Column C, add the following function:
=A1&"-"&COUNTIF($A$1:A1,A1)
Note: The relative reference on the count range will cause the applicable range to grow as it is dragged down. The count of the items matching that cell in a range containing only that cell should always be one. As it gets dragged down to include other cells, it will increment accordingly.
Then add the same thing in Column D to get the instances of cells in Column B:
=B1&"-"&COUNTIF($B$1:B1,B1)
Finally, do the math you want to do in Column E like this:
=IFERROR(MATCH(C1,D:D,0),0)

Need assistance with Excel 2010 filtered cells query

I am trying to create a summary sheet that details the amount of a certain product number found in a separate tab. The inventory tab has around 50k records that are filtered by certain manager names.
I need to search by the first four numbers on the inventory tab to match column A on the summary sheet.
Example: The summary sheet may list the model type as 1234, but the inventory sheet lists it as 123463AW3234.
| Model | Codename | Marketing | Quantity |
|-------|----------|-----------|----------|
| 1234  | CN 1     | MN 1    | 1        |
| 1234  | CN 1     | MN 1      | 12       |
| 1234  | CN 1     | MN 1      | 13       |
I would add a formula into column D cells (quantity) that takes the text from cells within column A (model type) searches that through the inventory tab, and lists the quantity of that model type.
This is the formula I have so far, but it detects all cells with 1234 anywhere in the test. I need to edit it where it will only search for the first four numbers taken from column A.
=SUMPRODUCT(SUBTOTAL(103,OFFSET('Development-Asset list'!G2:G33080,ROW('Development-Asset list'!G2:G33080)-MIN(ROW('Development-Asset list'!G2:G33080)),,1)),ISNUMBER(SEARCH(B5,'Development-Asset list'!G2:G33080))+0)
Column G is a seperate tab and contains the full 10 digit product number. I want to pull the data from the model cell (A1) and use it to count the number of products in the sep tab G row.
These rows are filtered which is why I am using SUMPRODUCT. So column G has product numbers like 1234abcde and I want to pull data from A1 (1234) and search column G for matches, but only the first four characters.
Any help would be appreciated!
How about:
=SumIfS(ColumnToSum, ColumnToSearch, Left(A2,4))
Check out the Sumifs function that allows you to set multiple search criteria. Notice that the item I searched for in the third argument is the left 4 characters of the search cell.
how about a simple solution like this:
=SUMIF($G$2:$G$999;A2&"*";$H$2:$H$999)
it sums up the data in column H, if G starts with the four digits of A.

Excel: Create Custom Sheet 2 Based on Data in Sheet 1

I have two sheets in a spreadsheet. Each sheet has a first column with common values (however they are not sorted the same and they are not all there in each sheet).
What I'm trying to do, if possible, is put a formula in sheet 2, where, if column 1 is a match for sheet 1, copies selective data from certain columns in that same row in sheet 1, to certain columns in sheet 2.
Example:
Sheet 1 has a heading setup and sample data row like this:
Title | Day of Week | First | Last
Supervisor | Wednesday | Mike | Jones
Sheet 2 has a heading setup and sample data row like this:
Title | Surname | Weekday
Supervisor | (empty cell) | (empty cell)
After running the mystery formula I'm looking for, placed in the 2 empty cells above, sheet 2 should match on the Supervisor key in sheet 1 and copy in data I have specified into each column, such as:
Title | Surname | Weekday
Supervisor | Jones | Wednesday
(In this case I have told it to map the "day of week" column to weekday, and map the "last" column to "surname").
I hope this is easy/possible??? Help???
VBA is not necessary. You can use a simple VLOOKUP:
=VLOOKUP(cell to look-up,
range where you want to look up the values (first column *must* contain the keys to look-up) including all columns that you want to retrieve,
the position of the column to be retrieved relative to the first column specified in argument 2,
0 (specifies you want an exact match))
For example:
=VLOOKUP(A1, Sheet1!$A$1:$D$150, 2, 0) ' Retrieves the 2nd column matching criteria in A1
Please notice, however, that you need your keys to be unique. Matching information based on the title seems a bit odd since it is likely there will be more than one person assigned to a certain role. For example, there may be more than 1 supervisor.
Use INDEX and MATCH (better than VLOOKUP).
I suggest renaming your headers so they match on both sheet.
Sheet 1 should be :
Title | Weekday | First Name | Surname
In sheet 2, cell B2 type in
=INDEX(Sheet1!$A:$D,match($A2,Sheet1!$A:$A,0),match(B$2,Sheet1!$1:$1,0))
You can drag and drop it in column C as well, it will work since you are using two MATCH functions with the cells properly anchored.

Excel getting totals for categories across worksheets

So I have column A (cat) and column B (Amt) on lots of separate works sheets.
Cat | Amt
1 | 3.4
4 | 7.4
2 | 8.4
4 | 9.4
What I need is to have a grand total for each category type across all the worksheets.
So a total for category 4, a total for category 2 etc.
This is more suitable for VBA solution, however if you know how many unique "Cat" you have, then it can be done without VBA.
For each sheet on C column add SUMIF formula, this will give sum for each group.
C2=SUMIF($A:$A,A2,$B:$B) - copy it down for each row.
On Sheet11 Column A is your unique "Cat" list. Columns B1 to K1, name them as Sheet1, Sheet2, ...Sheet10.
B2=IFERROR(VLOOKUP($A2,INDIRECT(B$1&"!$A:$C"),3,FALSE),0) - copy it for each row, column.
Column L will be GrandTotal.
G2=SUM(B2:K2) - copy it for each row.

Find two matching rows and display data from the thirt one (Excel)

So i have Two Sheets.
First sheet contains two columns
BRAND | LEFTOVER
The second sheet consists of two columns also.
BRAND | LEFTOVER (%)
So in case if the BRAND row value in the first Sheet will match the BRAND row value in the second i want to display the matching LEFTOVER (%) row value in the first sheet rows in the column LEFTOVER.
Kind of lost here.
Appreciate any ideas. Thanks.
In Sheet2:
. A | B
--------------------
1 BRAND | LEFTOVER %
2 X | Y
3 |
In Sheet1:
. A | B
--------------------
1 BRAND | LEFTOVER
2 X | =VLOOKUP(A2,Sheet2!A:B,2)
3 |
The VLookup function searches for its first parameter (in this case the value of Sheet1!A2) in the first column of the range denoted by the second parameter (in this case the leftmost column of the range containing columns A and B on Sheet2)
It then returns the value from that same row of the range that is to the right in the columns denoted by the third parameter (1 is the leftmost column where the matched value was). So in this case we use the number 2 because 1 means column A and 2 is column B (which explains why we used a two column wide range for the second parameter - it needed to encompass the column the result was in)
This isn't the only way to do this, but it is the easiest.
As Jerry stated VLOOKUP is the simplest way to do this.
HOWEVER if you have multiple/repeat instances (rows) in BRAND, VLOOKUP will only return the first record (row) that appears in your data.
If this is the case, you will need to add either a unique identifier column; and/or additional criteria to differentiate between the repeat instances.
As an example column A is used as a unique identifier to differentiate between the 2 'Nike' rows.
A B C
1 BRAND LEFTOVER
2 Nike 50
3 Adidas 25
4 Reebok 30
5 Nike 29
I feel that you can use vlookup to accomplish your goals.
Let me explain it in a bit detail.Suppose you have two sheets as:
A | B | A | B
--------------------- | -------------------
1 BRAND | LEFTOVER % | 1 BRAND | LEFTOVER
2 X | Y | 2 X | =Vlookup(A2,Sheet2!A:B,False)
3 | | 3 |
Sheet2 | Sheet1
After this you can drag this formula for the entire range. This will automatically make the formula correct for the below cells as well.
Also, if you need to populate any other fields from the Sheet2 then you can also use the vlookup as an array formula like: VLOOKUP(A2,Sheet2!A:B,{1,2,3,4},FALSE)
Enter this as an array formula using Crtl+Shift+Enter
Here {1,2,3,4} stands for the columns to be fetched.
If you want to know more about vlookup then read this article: http://www.exceltrick.com/formulas_macros/vlookup-in-excel

Resources