Create an array or list from text file and store values in labels (VB.net) - arrays

I have a text file with the following contents:
Andrew Law
32
6'1
123 Pounds
Tom Harris
19
5'5
180 Pounds
Randy Poffo
45
5'3
141 Pounds
Now on my form i have a listbox and four labels.
What i would like to do is have the listbox show only the names of the people in the text file (Andrew Law, Tom Harris, Randy Poffo) and when the user clicks the persons name in the listbox i would like each of the labels to show the corresponding details for that person (one label showing age, one showing their height and one showing their weight.)
I'm aware i could do this with a database however i would much prefer doing it by creating an array or list.
Any help would be so much appreciated!

Related

How to refer to an ever expanding column of data automatically?

I have a column of data which contains a list of unique IDs.
There are a set of tabs which then uses this list to display various associated data against each ID.
Presently, any time a new ID is added, I must manually add the new ID to each subsidiary tab in order to get the data.
I'd like to do this automatically, such that an addition to the master list populates into the tabs. I don't know of a way with my (limited) knowledge of google sheets to do this, however- any ideas? :)
The basic way to do this is to initialize the first column in each tab with a simple '='Master List'!A1' and copy it down. This works, but if you sort the master list, it plays havoc with tabs.
Difficult to explain, but something like:
Master List tab
12
13
35
111
Data Tab #1
12 Orange
13 Pear
35 Apple
111 Dragonfruit
Data Tab #2
12 Orange
13 Green
35 Red
111 White
Data Tab #3
12 Tart
13 Juicy
35 Crisp
111 Dried
...now, if I add 140 to the Master List, I must (currently) manually populate Data Tab #1-3. I'd like it to populate automatically.
I update the Master List, and all associated Tabs show the new entry.
In each Data Tab, instead of
'='Master List'!A1' and copy it down
try
=arrayformula('Master List'!A1:A)
This is an array formula and does not need to be copied down. It will populate the entire column with the IDs.
This works nicely too:
={'Master List'!A:A}
try like this:
=INDIRECT("'Master List'!A1:A"&COUNTA('Master List'!A1:A))

How to return the column heading for multiple matches, from multiple criteria, in Excel?

I'm working with 40+ price lists for different groups of customers. By entering the item number and price, I'd like to show the names of all the price lists that match that item/price. I've set up the items and pricing lists like the table below. Some items have the same prices in multiple price lists, and some price lists do not list all items.
Item ListPrice Red Blue Green Grey
Hosaka2 $200 $180 $188 $171
TrodesH $460 $410 $380 $400 $380
TrodesL $810 $680 $680 $720
Shuri $80 $72 $72 $70
I'd like to enter TrodesH and $380 into cells and have the formula return Blue & Grey. Or enter Hosaka2 and $200 and have the formula return ListPrice.
I've used this Index array formula in the past to return multiple matches to a single entry. To, for example, list all the account numbers whose address matches the zip code I enter. It's very handy. But here I'm looking for the combination of item and price. Any ideas how I might move forward?
Edit: For better legibility in the Excel file, I've placed the above data in a worksheet named "Matrix" and the lookup formulas in a worksheet named "Check."
Let's assume that A1:F5 contains the data, and H2 contains the item of interest, such as TrodesH, and I2 contains the price of interest, such as $380, try...
J2:
=COUNTIF(INDEX($B$2:$F$5,MATCH($H2,$A$2:$A$5,0),0),$I2)
K2, confirmed with CONTROL+SHIFT+ENTER, and copied across:
=IF(COLUMNS($K2:K2)<=$J2,INDEX($B$1:$F$1,SMALL(IF(INDEX($B$2:$F$5,MATCH($H2,$A$2:$A$5,0),0)=$I2,COLUMN($B$1:$F$1)-COLUMN($B$1)+1),COLUMNS($K2:K2))),"")
Hope this helps!
Taking the diagram below as a model (adjust it to your own data layout and places), you can enter this formula at J1 and copy/paste into the colored area:
J1:
=IFERROR(INDEX($1:$1,AGGREGATE(15,6,COLUMN($B$2:$F$5)
/($A$2:$A$5=$H1)/($B$2:$F$5=$I1),COLUMN(A:A))),"")

angularjs show table per field

I want to show the results of a MySQL query on my website using angularjs. For now, I'm showing them using a simple table with ng-repeat and it works with no problem. But because the data is a lot, I wanted to ask if it is possible to create multiple panels or tables per specific field.
To be more specific, I have 4 fields returned from the query: name, address, occupation, department. Right now I have a table such as:
George Smith Nikis 10 Project Manager Finance
Maria Bexley Lincoln 20 Project Manager Research
Chris Liggs Forks 123 Programmer Computer Science
etc. I want to know if I can create as many panels or tables as the unique values of the "occupation" field are and then show the results per that unique value inside each panel/table. So instead of the above table I would have something like:
Project Manager
George Smith Nikis 10 Finance
Maria Bexley Lincoln 20 Research
Programmer
Chris Liggs Forks 123 Computer Science
I think you need to use groupby filter
Check this fiddle by Darryl Rubarth, it contains the answer you need
http://jsfiddle.net/drubarth/R8YZh/
<div ng-repeat="item in MyList | orderBy:'groupfield' | groupBy:'groupfield'" >
You can use group by filter in ng-repeat with which you need to group

Database design for voting

I am implementing a voting feature to allow users to vote for their favourite images. They are able to vote for only 3 images. Nothing more or less. Therefore, I am using checkboxes to do validation for it. I need to store these votes in my database.
Here is what i have so far :
|voteID | name| emailAddress| ICNo |imageID
(where imageID is a foreign key to the Images table)
I'm still learning about database systems and I feel like this isn't a good database design considering some of the fields like email address and IC Number have to be repeated.
For example,
|voteID | name| emailAddress | ICNo | imageID
1 BG email#example.com G822A28A 10
2 BG email#example.com G822A28A 11
3 BG email#example.com G822A28A 12
4 MO email2#example.com G111283Z 10
You have three "things" in your system - images, people, and votes.
An image can have multiple votes (from different people), and a person can have multiple votes (for different images).
One way to represent this in a diagram is as follows:
So you store information about a person in one place (the Person table), about Images in one place (the Images table), and Votes in one place. The "chicken feet" relationships between them show that one person can have many votes, and one image can have many votes. ("Many" meaning "more than one").

Vlookup array multiple columns

Excel wiz's,
I'm trying to build a report with a simple drop down list of names. Rather than try to explain in more detail, let me give you a sample dataset:
Table1:
Text Person1 Person2 Person3
String here contains name(s) Mike Smith Robert Johnson Suzy Q
Another string with name(s) Dan Boy John Michael Bob Wise
Different string with name(s) Robert Johnson Suzy Q
In my report sheet, I have a drop down list of all the possible "persons" that I want to chose from and then return all values from the "Text" column in an array. I have been able to make it work with only one column using this formula, where C4 contains my choice in the dropdown list:
INDEX(Table1[#All],SMALL(IF(Table1[Person1]=$C$4,ROW(Table1[Person1])),ROW(1:1)),1)
The text column will contain all the names of the Person columns, but they are in a different case (all caps, can't change format for display purposes). Maybe a SEARCH function would be more useful? I'm not sure. I'm trying to avoid using a macro, but I am not completely opposed.
Let me know what you guys think, and thanks in advance!
Simply re-organize your table so that there's one row per name... the V-Lookup on the name and get the matching list.
Person Text
Mike Smith String with names
Robert Johnson String with names
Suzy Q String with names
Dan Boy Second string with names
are you trying to make validations for teams? like select team, then next drop down gives only members of that team?
you can use offset inside validation. in one cell put a validation for the list of teams. in the other cell, create a list validation, use a offset formula to return the range of members based on the selected team.
edit: not sure how to put in a table, but this is how you would fill a range with vlookup
in the table with the entries, add a column with serial number starting from 1-n
just below the drop down box, enter numbers 1 to n in order
vlookup the serial number in the table, that is the row you are looking up
for the column, use a match to look in the table which column the current selected person is
drag the formula down to fill n numbers

Resources