Creating an Index(Match()) for Multiple Criteria, with Multiple Results for Multiple Dates - excel

The solution to this problem has been evading me and admittedly hurting my brain a little bit, so hopefully someone here can lend a hand. Essentially, I have around 10 columns of data. One of these columns contains the identifier I want to use, another column has the date I want to reference, and the rest of the columns are the values I want to use to populate the table. What I'm trying to do is build a tool where you type in the identifier and the date and it tells you what the other columns are for that particular pairing.
The problem is, however, that the data set contains multiple repeated dates (dates are in a column), and sometimes repeated identifiers. So identifier 1 may appear three times on 1/1/2018, then appear three more times on 1/2/2018.
Forgive my inexperience, as this is probably the incorrect way to show this, but this is what I want my data to look like, with the bins being the 1st, 2nd, and so on occurrences of the same identifier on the given date:
Identifier - A1
Date - 1/1/2018
Bin Column1 Column2 Column3 Column4
1 1 2 3 4
2 1 2 3 4
3
4
5
The Identifier and Date would be manual entries and the rest of the table would be automatically populated. I've been looking up different ways of using index(match()) all morning and have yet to achieve any success. I'm not sure if I'm approaching this incorrectly or what, but any help with this problem is greatly appreciated.
PS - I understand that a pivot table would likely give me the information I need, however, this table isn't for my own use, so I'm trying to make it as straightforward as possible (enter two lines, necessary info pops up).
Edit - This is how the data is currently set up:
`

Use this:
=IFERROR(INDEX(C:C,AGGREGATE(15,7,ROW($B$2:INDEX($B:$B,MATCH("zzz",$A:$A)))/(($B$2:INDEX($B:$B,MATCH("zzz",$A:$A))=$J$2)*($A$2:INDEX($A:$A,MATCH("zzz",$A:$A))=$J$1)),ROW(1:1))),"")
Note: realize this is an array formula that is entered normally with Enter, but as an array formula it will slow down the calcs if the dataset is large.

It generally looks like:
=INDEX('range all of the data, not the headers', MATCH('row header value to match','the row headers range',0), MATCH('column header to match','the column headers range',0))

Related

How do I recieve the number of cells based off of three columns in Excel?

I'm not too sure how to word this problem so, I apologize for the vagueness. Here is what I am trying to do though:
I have a large Excel table with a ton of values, I however, only care about 3 columns. The three columns I have are "Project Name", "Active/Planned", and "Week of Month". Here is an example of some values I would have:
Project Name
Active/Planned
Week of Month
StoreProj
Active
2021-07 Jul-Wk1
SecProj
Planned
2021-07 Jul-Wk2
StoreProj
Active
2021-07 Jul-Wk1
Now, I have used a formula to get the number of projects based on a specific week month and avoiding duplicate values for the project name. The code I used returns an integer of the number of projects. Here is what I used:
=IFERROR(ROWS(UNIQUE(FILTER(Table[Project Name],Table[Week of Month]=2021-07 Jul-Wk1))), 0)
This works as intended. Now the issue I am running into is that I need to filter through these rows as I did previously, but now I need to include the "Active/Planned" column. So, I want to be able to see how many projects I have based off of the week of the month and return a number of projects (excluding duplicate names), but be able to filter through that integer output based off of the active/planned projects. So in a perfect scenario I can choose the week of month and if the project is "Active" or "Planned" and see the amount of projects I have.
This might be an easy fix so I apologize, I am just stumped, any help would be greatly appreciated. Thanks!
Work through that step by step, you've got the FILTER function which is giving data to the UNIQUE function, to the ROWS function, and then your IFERROR. However, the data about whether each line/row is 'Active' or 'planned' isn't passed out beyond the FILTER function, so can't be used by anything further on in the above sequence.
Boring theoretical advice out the way, try this;
=COUNT(IF(UNIQUE(FILTER( Table[[Project Name]:[Active/Planned]], Table[Week of Month] = "2021-07 Jul-wk1"))= "Active", 1))
Explanation:
FILTER(...) outputs records with the relevant date filter, however it outputs Table[[Project Name]:[Active/Planned]] - both columns, to ensure all relevant data is there.
UNIQUE(...) Then narrows that down to unique values, although by this stage I'm not 100% sure you need this.
IF(... = "Active", 1) then replaces the 'Active' outputs with 1s
COUNT() returns the number of cells in the above that contain a number (the 1s from the IF())
Yes, you can't use COUNTIF on arrays (and all except that last bullet point above are outputting arrays not single values) - and no, I didn't know that before attempting to answer this question, found it over at a different question!

If match found yes/ no, two different tables, two different values

I did not see something like this in other questions/ forums so hopefully it can be done.
Need to know if values from one table are in another, checking to see if there is a match.
Table 1 in Sheet 1 is used to record "Incoming" data of Part Number and Lot Number.
Table 2 in Sheet 2 is used to record when record is "Outgoing".
Column A is Part Number, B is Lot number in both Sheets. Part number can repeat, but Lot # will not. Trying to find a way to return a Yes/ No or 1,0 if part number and lot number in Sheet 1 exists in Sheet 2 in Column C of Sheet1. I have attached a Snippet example what I am trying to do. This will help me generate info on if an Incoming record has been completed and left (Outgoing). I do not believe vlookup will work and have tried some different permutations of match. Open for other options. Thanks!!
Edit: Lot # does have to ablity to repeat (not often) but with a different corresponding Part Number. Need to know if there is a match with both Lot# and Part Number as in the Incoming record.
Use:
=--(COUNTIFS(Sheet2!A:A,A2,Sheet2!B:B,B2)>0)
If there are matches it will return 1 if not 0

What to use: COUNTIF or Vlookup or combined or else?

I got a big data file where I have to count how many events is per one serial number (in my case P/N) through more sheets (years). Those serials are in Column A (grey). On second picture is lookup table, so the data from where I have to search and Count events looking at (Column O - yellow) and Column A (artikel), using terms from Column P for all the sheets, I mean through different year. All sheets are consistent and looking exact the same.
What I tried to do is: COUNTIFS(A2:A142;VLOOKUP(A2;'Spareparts 2015'!$A$2:$O$164;15;FALSE))+COUNTIF('Spareparts 2015'!O2:O164;"Ersatz im Rahmen einer Wartung") to look for specific term but this is not what I wanted.
Idea is to get all these specific "terms" using P/N through all years (summed), to see how many times serial number (P/N) has been used through years. And I need total number (of 5 years). As you see in main table there are more serials, and everything what is needed is some good positioned function which I cant get...
Hopefully I was clear with my issue, it is a bit hard to explain, but I eager to provide more infos!
UPDATE!
This is actually what I wanted to accomplish (with Pivots is possible)
For every Serial (artikel) that I have in Calculated sheet, I wanna look and count all instances (Grund fur ersatz in Column O) through years and different sheets. Every sheet has mixed serials, and these occurrences, so I have to couple them with main table and to count total number of them, how many times something from Column O appeared in some of Serials through 5 years.
One option is using Pivot tables actually, but I wanted to know how I can solve it with formulas also.
EDIT #2
Given that the relationship between each serial number and the look up term is 'Many to Many' but not 'One to One', one way to count the occurrence of each term for each serial number is to
Firstly put all 5 years of data into one big table, and name the following ranges:
Name_All being names in Column O of the master data table;
SN_All being serial numbers in Column A of the master data table.
Secondly, create a look up sheet to list all serial numbers and associated look up terms as shown below:
Then you can use COUNTIFS to count the occurrence for each term per serial number:
=COUNTIFS(SN_All,A2,Name_All,B2)
See following screen-shot for more clarifications.
A better/quicker approach would be using pivot table as being mentioned by OP.

Sorting and matching two column with uneven sets of data in Excel

I have two columns like this:
Initial Table
COL-A and COL-B are coming from two different files. I have to do two things: a) match these two columns, b) find which data is missing. What I do, I insert a third column, COL-C, by adding VALUE(LEFT(B2,6)). Then I sort COL-A individually. After that, I sort COL-B and COL-C based on the value in COL-C. Then I deduct COL-A from COL-C in COL-D, move data manually to find the missing value. Finally, it looks like this.
Final Table
I work with these data every day. Numbers of data change daily, maybe today I will have 250 data, maybe the next day it will be 400 and this is a very important thing to remember. I was wondering if anyone can tell me how to get it done in a single click. I am willing to use VBA if needed. My Excel version is 2016. Thanks.
Sorry, this is not elegant, but will work without manual re-arrangement of COL-A or COL-B
In Col C, do as you thought, strip the first 6 characters of B
=IFERROR(VALUE(LEFT(B2,6)),0)
Then in Col D use a VLOOKUP to identify the missing ID from column A
=IFERROR(VLOOKUP(A2,C:C,1,FALSE),"Missing")

How to distinguish between two "stale values" and blanks in between two values in a column of data?

I recently asked a question about linear interpolation of data for missing values. Here is the link to that question
What is the dynamic solution to a linear interpolation of data in a row with missing values with an indefinite number of missing value sequences?
A new problem has arisen that pertains to the case where the blank sequence ends in a blank, and not a filled value.
In that case, the formula repeats the last filled value in those latest blanks. What i want to do is, have some way like conditional formatting or adding a 0.0000009 sort of number to distinguish it as stale data.
Below is the sample data:- (This data is the result of a formula that is described by the solution provided)
Date Data Updated Data
1/1/2001 1 1.000000000
2/1/2001 2 2.000000000
3/1/2001 3 3.000000000
4/1/2001 4 4.000000000
5/1/2001 4.250000090
6/1/2001 4.500000090
7/1/2001 4.750000090
8/1/2001 5 5.000000000
9/1/2001 6 6.000000000
10/1/2001 7 7.000000000
11/1/2001 7.666670090
12/1/2001 8.333330090
1/1/2002 9 9.000000000
2/1/2002 11 11.000000000
3/1/2002 11.000000090
4/1/2002 11.000000090
How can i distinguish between the last two 11s and the normal data up above? Since this data is stale and technically not the right data.?

Resources