Nested list in excel - excel

I'm not even sure how to ask this.
I have a database, where each row is a person. Columns are contact info, phone, etc. One column is 'date visited'. There can be multiple dates visited for each person. I don't want to use a comma or stack them all in one field.
Is there a way to have a 'nested' list (not a drop-down menu - just a list of visited dates for each person), such that one person still only consumes one single row?

Yes,
To accomplish this give each person an ID that is unique and won't change.
Then on a separate sheet, store the ID and date.
main sheet ( ID, Name, Contact Info, phone, ect)
second sheet ( ID, date visited)
In database theory this is called a 'one to many' relationship, and what i'm describing is called 'normalizing your dataset'.
In Excel you can now use formulas to manipulate the data however you need to or can imagine after you split this apart.
As you mentioned in comment, counting all visited dates for a user.
On the main sheet to the right you could use:
=countif(Sheet2!A:A,Sheet1!A1)
This would Count all of the ID's in the second sheet that match the current row's ID on your main sheet.
Notes about using one cell:
Storing all the dates in one cell will eventually max it out, and will make it hard ot view/search as it grows so i highly advise against this approach.
If however you insist on keeping the dates in there, you could count the visits by counting the total number of comma's + 1 liek this =(LEN(G1) - LEN(SUBSTITUTE(G1,",","")))+1 This formula takes the length of all the dates, and the length of dates with commas removed and subtracts them to get a number of occurrences.
Notes about using multiple columns:
This approach has the same idea as the one I suggested, where we are associating a number of dates with the row's identity of a person. However, there are a few key limitations and drawbacks.
The main difference is that when we abstract the dates by transposing them to extend vertically we can manipulate them easier, and make a list of 20 dates for one person much easier to read. By transposing the dates vertically in the second sheet instead of using this approach we also gain the ability to use Excel's built in filter. Just storing large amounts of data is useless by itself. While storing it in a way that you can view and manipulate easy makes everything much more powerful.

Related

How to identified the smaller number only from specific lines of a table

I am not familiar with excel as you can probaly guess by my question so I am sorry if it's a silly question but I have been googling for a long time and I can't do it.
I manage to do it in excel 365 with the function filter, but I can't on excel 2019 (I am required to do it in excel 2019)
I want to identifed the smaller number of a specific combination of cells using two table.
Table1 has name of people and places as well as a number. (the number shows the difference of the last time a person went to a place and the [in months])
(In this project the inspector cannot go to the same place twice unless 4 months have pass, thus why I want the smaller number, using the date of the last visited and the fcuntion now I get teh number of months that have pass)
Table2 has only the name of one person out of these people but has the name of all places. I want to get the smaller number for every place.
This is my table1: (I hided other peoples names so I can show a more compact examlplo)
And this is my table2:
I thought that I could use a function aggregate with a function if inside of it to get only the values that I desire.
It did not worked thou. Was I had miss undertand the fact that function if only gives me true or false. But thought that the aggregate function could wordk. It did not as well
=AGGREGATE(5;3;A2&B2=Table1[#Place]&Table1[#name];1).
overall my question could be summarize to which funtion should I used?
Which function should I use?
obs: In excel 365 I used concat to make a code an thus only used one cell, but I don't see why it wouldn't work if I just select two cells insted of one (teh concat cell)

Return Column Index for Each Matching Value in a Row?

Excel Novice using Excel for Business (Online) here.
I am having a difficult time wrapping my head around a way to write a function that does three things for me.
Check a specific row of data in a large table, preferably matching ID's between the two tables (I've been using XLOOKUP to ensure that results are keyed to a specific ID)
Find and return the Column index for every cell within the row with the string "Yes"
SUM associated points tied to the column indexes.
I am creating a new QA Scoring system, and all of the questions share the potential for "Yes" and "No" but depending on the question the number of points will be different. I have been approaching this with the idea that I could return the column indexes, convert them to the points associated to the column indexes, and then SUM them for a score, but I am open to different ideas.
Click Here for a Demo of what I am trying to do, included is the actual data set I was using.
Possible Points
=SUMIFS($O$2:$AH$2,INDEX(Raw_Data!D:W,MATCH(Scoring!A4,Raw_Data!A:A,0),0),"*")
Points Earned
=SUMIFS($O$2:$AH$2,INDEX(Raw_Data!D:W,MATCH(Scoring!A4,Raw_Data!A:A,0),0),"Yes")
These will work with your present setup, but in the long run it would probably be best to just add Possible Points and Points Earned columns to your Table3, if possible.

MS Excel: is there a simpler way to use an IF statement to check for matching data and output a date?

I have a list of lot IDs and dates in one tab ("Lot IDs"), raw data in two others, and data for presentation in the last tab ("Selected Data"). In the Selected Data tab there is an IF statement that checks to make sure the lot ID on a given line matches one of the lot IDs in the Lot Data tab and, if it is true, it outputs the date associated with the lot.
A snippet of my function, from the Selected Data tab:
=IF(B2=LEFT('Lot IDs'!$C$2,6),'Lot IDs'!$D$2,IF(B2=LEFT('Lot IDs'!$C$3,6),'Lot IDs'!$D$3,IF(B2=LEFT('1303 Lot IDs'!$C$4,6),'Lot IDs'!$D$4,"false/paste pattern here")))
where
B column holds lot ID numbers
Lot IDs'!$C column holds lot ID numbers
Lot IDs'!$D column holds dates
This function is getting very long, over 30 repetitions.
Is there a way to generalize this function so I don't have to keep repeating the same pattern?
Use INDEX/MATCH with wildcards:
=IFERROR(INDEX('Lot IDs'!$D:$D,MATCH(B2&"*",'Lot IDs'!$C$:$C,0)),"false/paste pattern here")

How to find 1st, 2nd, 3rd most occuring text string in Excel using functions?

I am really having troubles with this one:
In one column, I have a long list of company names. The company names appear several times (based on how many tickets they have raised, but that is another story).
I am now looking for a function that would give me the Company name that occurs the most often. In the Cell below I would like to get company name that occurs the second most often. In the Cell below the company that occurs the third most often end so on and so on.
I thank everyone who is spending some time to help me figure this out.
Stephan
Make a PivotTable out of the data. Put the field of interest in it as both a Row Field and as a Values field, and make sure that the aggregation being applied is a Count. (It will be by default if your things are text).
See my answer at Excel, i have a big list (44000 records), i would like to sepperate them into 2 lists, 1 with unique values and 1 with duplicate value's

Grouping rows by area codes

I have a table of customers to which my company ships products. The problem is that these customers need to be sorted by their area codes, so that the products can be sent to the appropriate shipping companies (we have two partner companies that ship to certain parts of the country). Each company sent us a list of area code numbers to which they can ship and I need to divide the Excel sheet into two sheets, each containing the customers with the area codes compatible with the respective company.
I tried to solve this problem with VLOOKUP function, but it only works on individual row basis, and I need a solution that will find all rows that contain a number from the specified group of area codes.
Another way would be IF function that would put a True or False (one IF function for each company) value in new column and then I could sort by that value, and copy the data into a new sheet. This approach would work, but the IF function would be extremely long and hard to control.
Can you suggest a way to solve this problem?
Edit to incorporate details provided via Comment:
Presently I have about 5,000 rows but in future it might be more though I doubt over 10,000 rows.
A VLOOKUP seems very promising, of the kind =VLOOKUP($B2,F:G,1,0) in C2 copied across and down as required, with a layout as below:
This does not group as you say you require (but do you really need to?) because it seems possible some locations will be served by both shippers. You might resolve this by flagging those rows where both are viable and then by sorting to split into three groups (Shipper1 only, Shipper2 only, both) before transferring the ranges as desired.
Edit in response to OPs comment
If you can be certain there is no overlap between Shippers, a single column with this formula, say in E2copied down, might be preferable:
=IF(ISERROR(MATCH(B2,F:F,0)>0),"Shipper2","Shipper1")
and would not routinely show #N/A. (This assumes no area is outside the range of both shippers.)

Resources