I have the below array to detect 3 different criteria and return multiple results from a data source with 10000 Rows.
{=IF(INDEX(Inventory!$A$3:$Q$10000;SMALL(IF(($C$4=Inventory!$A$3:$A$10000)*($C$3=Inventory!$E$3:$E$10000)*(Inventory!$F$3:$F$10000="NEW");ROW(Inventory!$A$3:$A$10000)-ROW($C$3)+2);ROW(Inventory!1:1));16)=0;"";INDEX(Inventory!$A$3:$Q$10000;SMALL(IF(($C$4=Inventory!$A$3:$A$10000)*($C$3=Inventory!$E$3:$E$10000)*(Inventory!$F$3:$F$10000="NEW");ROW(Inventory!$A$3:$A$10000)-ROW($C$3)+2);ROW(Inventory!1:1));16))}
The Inventory table goes like this
A |E |F |P
Standard Laptop |Lisbon |NEW |XCVBMT
Engineering Laptop |London |DAMAGED |CVFTYU
Multiple Vendor |Madrid |QUARANTINE |CVBLPU
Standard Laptop |Lisbon |NEW |JKHGLK
I Have A and E criteria to select from drop down lists in C3 and C4.
If I delete the below criteria from the array, it works:
($C$4=Inventory!$A$3:$A$10000)
I cleared all formats, changed rows, changed the criteria to D4 and tiped in manually, trimmed... I think is right in front of me but have no clue on whats wrong.
I hope this is enough information.
Thanks
Related
I am trying to perform an index and match formula in Excel with a two large datasets which will return multiple unique results.
I have illustrated a simplified version of the data below. The two match conditions are A1 in table 2 = A:A in Table 1 and B2 in table 2 = B:B in table 1. This will result in multiple results and I want a formula I can drag from cells C3 across to D4 in table 2 to show the results of this index and match.
Table 1
First Name
Second Name
Food allergy code
Bob
Johnson
03
Bob
Johnson
04
Table 2
First Name
Second Name
Food allergy code 1
Food allergy code 2
Bob
Johnson
03
04
I have used the formula below which returns the first match, but when I drag this from cell C2 to D2 it returns the same value. I'm not sure how to rewrite this formula so that it provides each unique Food allergy code given both match conditions are met.
=TRANSPOSE(INDEX(Table1!C:C,MATCH(1,(Table1!A:A=A2)*(Table1!B:B=B2),0)))
Any help would be appreciated.
You could use the following, but it is computationally rather inefficient, so if you want to drag this formula over many cells, you should leave a comment to find a computationally more efficient solution.
=TRANSPOSE(FILTER(D:D,(B:B=G4)*(C:C=H4)))
which looks like this in an example:
Summary
I have a database of ~1500 entries. Some of them have more than one entry (up to 5) under the same identifier. I have a pre-set list of IDs I would like to check to see if they have multiple records, and if so, pull all of them, so I can compare them for differences.
Current solution
I currently have this working correctly, using a method to pull the 1st, 2nd, 3rd, 4th and 5th response respectively. The current formula is:
=INDEX('DATABASE'!$B:$B,SMALL(IF($A2='DATABASE'!$A:$A,ROW('DATABASE'!$A:$A)-ROW('DATABASE'!$A$1)+1),1)) for the 1st result, =INDEX('DATABASE'!$B:$B,SMALL(IF($A2='DATABASE'!$A:$A,ROW('DATABASE'!$A:$A)-ROW('DATABASE'!$A$1)+1),2)) for the second, and so on. In this case, the above code would check the value in A2 (ID2Check), and then do a match for it on the 'DATABASE' sheet in column A. If it matches, it will return the first value that matches from column B. The second piece of code above does the same, except it returns the second match from column B. ID2Check is populated by me, and the Results 1-5 are the code output. For example:
Database:
ID
Data Item
AAA
Lemons
111
Greenhouse
FOO
Computer
AAA
Monitor
CAT
Coffee
ORANGE
Pintglass
123
Birthday
FOO
Avengers
AAA
Plasters
FOO
NachoTaco
Code output:
ID2Check
Result 1
Result 2
Result 3
Result 4
Result 5
AAA
Lemons
Monitor
123
Birthday
FOO
Computer
Avengers
NachoTaco
Problem
This solution works correctly, and will pull the expected values as required. The problem is, as this code needs to be entered 5 times per identifier, and there are ~1500 records to check, I need to flash fill 7500 formulas. Unsurprisingly, this leads to Excel crashing and becoming unresponsive for the best part of 30 minutes. I am looking to find a solution that would be more efficient and stable when running en-mass. Any assistance would be appreciated.
Final Notes / Info
I'm using MSO 365, version 2202 (I cannot update beyond this). This will be run in the Desktop version of Excel. I would prefer this is done exclusively using formulas, but I am open to using Visual Basic if it would be otherwise impossible or incredibly inefficient.
=UNIQUE(C5:C15)
=TRANSPOSE(FILTER($D$5:$D$15;$C$5:$C$15=F5))
If you have access to HSTACK() function then could try-
=HSTACK(UNIQUE(A2:A11),TEXTSPLIT(TEXTJOIN("/",FALSE,BYROW(UNIQUE(A2:A11),LAMBDA(x,TEXTJOIN("|",TRUE,FILTER(B2:B11,A2:A11=x))))),"|","/",,,""))
I have one set of data with fields
StudentId, Name , Address in one dataset and being used in one Tablix.
also another set of data: StudentID Subject Marks in another Dataset and using Matrix to Pivot in the Report.
I am able to fetch the Report in this way
StudentID Name Address MAths Physcis Chemistry Median
1 Mike NJ 85 70 90 2
2 David CA 81 85 90 1
I was calculating Median by counting number of Subject Marks greater than 80.
Now how do I use the value of Median in Tablix instead of in Matrix.
Below should be the expected output format
StudentID Median Name Address MAths Physcis Chemistry
1 2 Mike NJ 85 70 90
2 3 David CA 81 85 90
Note: I am using Matrix to Pivot Subject Column in SSRS Report. I am using Pivot operation in SSRS instead of performing in SP because I get 40 columns after Pivoting in SP and need to physically map 40 columns. Here in example I have only given 3 columns(Maths, Physcis and Chemistry).
Also please do let me know if expected output format is at least possible.
Is there any way that I will be able to Pivot Subject Columns inside the Tablix itself instead of using the another Matrix??
Thank you.
There are two ways to typically go about an aggregation like this. If you stick with the two existing datasets, you'll have to use the Lookup or LookupSet functions to get data from the other dataset. For example, if your table/matrix is using the second dataset as it's source, you would Lookup the Name of each student. Keep in mind that this is not efficient for large reports.
The other approach, which I would recommend, is to join these two datasets in SQL and use that as the data source for the report. This is more efficient and makes the report simpler to maintain.
It's good that you are letting the report do the pivoting for you, it works much better that way.
I will try to explain what I would like to achieve, and since I have not looking for ready-to-go solution, I hope you will give me pointers what to look for.
So, I have one sheet in Excel (Libre, Apache whatever) where I want to keep track of the inventory in offices. I don't have many of them, thus I have opted for something simpler that Access or any other database
So for example in Office 122 I have Dell computer XZY
Now, on next sheet 2 I would like to keep properties of that particular computer (as table for example)
Dell computer XZY | CPU Xenon | Nvidia 980 | RAM 16GB
Dell computer AAA | CPU I7 | AMD 290X | RAM 32GB
and so on
Now, on the first sheet I have columns
Office | Computer | Specs
I would like to be able set column Computer from drop down selection name of the computer from sheet 2 e.g. Dell computer XZY, and to print out its specs in Info column automatically from the sheet 2 which holds computer names and specs of the computers so it looks something like
Office 122 | Dell Computer AAA (this should be drop down selection) | I7, AMD 290X, 32GB
I hope I was clear enough :). As I said, I don't expect you to make me the sheet (wouldn't mind, but not expecting), just to tell me what I am looking for and where to search since I didn't have any experience with this kind of "databases" in excel.
Thanks in advance
Part 1 make dropdown
On sheet2 make columns
Restrict your cell to values from a list of items
select cell
select data validation
select allow list
select range
Thats it
http://blogs.technet.com/b/hub/archive/2011/06/09/restrict-data-entry-in-excel-with-lists.aspx
Part two -lookup value
With excel formula VLOOPUP you can loopup a value, witch mist be unique and you can select the row which value it should return. Something like this
=VLOOKUP(B4,Sheet2!B:C,2,FALSE)
I have an Excel document with 10000 rows of data in two sheets, the thing is one of these sheets have the product costs, and the other has category and other information. These two are imported automatically from the sql server so I don't want to move it to Access but still I want to link the product codes so that when I merge the product tables as product name and cost on the same table, I can be sure that I'm getting the right information.
For example:
Code | name | category
------------------------------
1 | mouse | OEM
4 | keyboard | OEM
2 | monitor | screen
Code | cost |
------------------------------
1 | 123 |
4 | 1234 |
2 | 1232 |
7 | 587 |
Let's say my two sheets have tables like these, as you can see the next one has one that doesn't exist on the other- I put it there because in reality one has a few more, preventing a perfect match. Therefore I couldn't just sort both tables to A-Z and get the costs that way- as I said there are more than 10000 products in that database and I wouldn't want to risk a slight shift of costs -with those extra entries on the other table- that would ruin the whole table.
So what would be a good solution to get the entry from another sheet and inserting it to the right row when merging? Linking two tables with field name??... checking field and trying to match it with the other sheet??... Anything at all.
Note: When I use Access I would make relationships and when I would run a query it would match them automatically... I was wondering if there's a way to do that in excel too.
Why not use a vlookup? If there is a match, it will list the cost. Assuming the top is sheet1 and the other sheet2 and they both start on cell A1. You just need this in cell D2.
=VLOOKUP(A2,Sheet2!A:B,2,0)
You can then drag it down. Easiest way to fill all your 10000 rows is to hover over the bottom left corner of the cell with your cursor. It will turn from a white plus sign into a thin black one. Then simply double click.
Just use VLOOKUP - you can add a row to your first sheet, and find the cost based on code in the other sheet.