Creating keys/unique values for rows - excel

I couldn't find the answer here, probably because of a lack of understanding the terminology.
I have created a sheet with several classes, and want to assign a unique ID (starting at "1") to each cell in the "Genus_ID" column. It must restart at 1 every time it identifies that it belongs to a new Family or Subfamily. Basically how a relational database would be designed.
Here is a sample of my sheet:
The Genus_ID is counting upwards, but it should reset to "1" at every new Family OR Subfamily.
Also, in I3 it shouldn't say "Porifera", but it should iterate the previous value ("1").
So, like this:
I'm using the following formula right now, it's close, but nowhere near perfect yet:
=IF(COUNTIFS(A$2:H2,H2)=1,MAX(I$1:I1)+1,VLOOKUP(A2,A$1:I1,2,0))
Can anyone help me out?
Thanks a lot!

If FAMILY is column D and GENUS is column H, try this in I2 and copy down
=IF(D2<>D1,1,IF(H2=H1,I1,I1+1))
If SUBFAMILY is in column F try this
=IF(OR(D2<>D1,F2<>F1),1,IF(H2=H1,I1,I1+1))

Related

Creating a binary flag to return whether someone has used a product in the last n days

I have three variables: the person using the item, the date the item was used, and the brand. I'd like to create a flag that indicates whether a specific brand (in this case, BrandA) was used in the last n days by a given person.
The Y-AA columns are an example of the data that I'm working with, and the AB column is the desired result.
Example
I know at the end I'll probably have =if( , True, False), but I'm not sure what would make up the argument.
Any help would be appreciated, thank you!
I think you need to consider how you're setting up your data. Below is an example of how you can create your IF conditions to make it work -- using data that is unclear in your post.
Set up your data like so, with cell Z1 using the name AnchorDate.
Then the formula entered in cell AB4 and copied down and across will be
=IF(AND($Y4=AB$1,$AA4=AB$2,DAYS(AnchorDate,$Z4)<=10),"Yes","No")

Count categories changes in Excel

I have specific problem which is best described by a picture.
E1:G10 are rules for categories e.g. change from cat C to C will cause 1 hr delay.
There are products which fall into category of a products A, B and C. Next to it you can find quantities of which they are produced.
f you want to rebuild machine from cat. A to B etc. it will cost you time (ruling is described next to it).
I need to find a way how to determine time of rebuild. I did it manually and you can see it column C. However, I wish Excel would do it automatically. Later I am using data in solver.
Does anyone know solution to my problem?
Thanks in advance.
I would use the formula sumifs.
For example the first category "C" with 1000 parts will change to category "A":
"=sumifs(G:G, E:E, A2, F:F, "A")"
I would also suggest you to put additional column with target category change and implement it to the formula.
Hope it helps.

INDEX function to locate customer ID when entering Name

I've recently started working with Excel due to running my own business now. As with anything I do, I want my logs to be practical, efficient and most of all working correctly. I'm almost satisfied with what I got so far but I can't seem to figure out how to let Excel look up a customer ID.
Basically what I want is:
In the first sheet I add a customer by name in column B, his assigned customer ID is in column A
In sheet 2 I type in the name of the customer in column E and I want Excel to look up that lastname in sheet 1 and then add the related customer ID in sheet 2 in column A
The reason for this is that I have returning customers and I don't want them to have a new customer ID, I want them to have the same ID as they had previously without going through all my customers to look if they are a returning customer and if so what their customer ID is.
I've been playing around with the INDEX function as that seemed to be the function used for this kinda stuff, but I just can't figure it out.
I look forward to hearing your tips and tricks in regards to this issue, thanks in advance!
Marc
In Sheet 2 A2
=INDEX(Sheet1!A:A,MATCH(E2,Sheet1!B:B,0),1)
This answer would work for you assuming Sheet1 stores ID in A, name in B, and your second sheet has you type the name in E.
Caveats being that matching based on typed names are extremely prone to error, it would have to be an exact match. Perhaps consider using data validation or a more robust solution in the medium term.

Compare and Compile data from various Columns into 2 columns

Im having some difficulties with getting excel to do what I want.
The situation im in:
Every week, i get a report of about 500 worker IDs with some values. These IDs and values does not come with the name of the worker. So what im trying to do, is to have Excel search for the IDs in another column and the return the worker name from 2 columns (first and lastname).
The layout:
A: Workers Name
B: Worker ID
D: List of IDs without name
E: list of values, that the worker has produced throughout the week.
Result should be something like:
If Worker ID from D exits in B, then it would take Worker name from A and the value from E into G and H.
G: Worker Name
H: Value from E matching the same ID from E.
Is this even possible? Since i havent been able to figure out a suitable solution, which would make my job a lot easier and make me able to use more time on actual work, than on getting excel to work as i want it to.
I have been looking at VLOOKUP, but havent been able to wrap my head around, how it would be possible to make it work.
Any help is appreciated.
Layout of Sheet
If I understand correctly:
Vlookup() is a nice function, but you cannot return a value from column 1, by looking for data in column 2. You want to use Index/Match.
A quick test: Say your ID you want to look up is in X2, and your columns are as outlined...try this =Index($A:$A,match(X2,$C:$C,0)) which should return the First name for the user.
To get the second name, just combine two formulas together with a separator: =Index($A:$A,match(X2,$C:$C,0))&", "&=Index($B:$B,match(X2,$C:$C,0))
Edit: Hm, here's a screenshot to hopefully clarify if I understand your question, and you can see how the match should work:
So, as you drag that down, in H4, it looks for m59908 from Column D, searches for it in column B, then returns the name from Column A of that row.

Can excel clean up free-text user entry?

any help would be massively appreciated - I'm really stuck on this.
I have a field on a user entered form that asks people what university they've attended which, due to technical limitations on our system, has to be free text.
This invariably leads to hundreds of different entries for each university, which means I have to use filter on excel and comb through thousands of entries and manually unify - lack of knowledge on how to automate this limits it's practical use massively.
Does anyone know a way we can automate this process of categorizing (and then unifying) different entries which refer to the same thing (e.g someone might put UCL, another might put "university of college, London" and another "university of college london" - I need to teach the system that all 3 are the same and then convert it on excel).
I have a list of the exact entries we want for each university, and I'm happy to manually 'teach' excel when a user entry matches one of these, providing it then learns this for the future (so as time goes on, we have to less and less manual unifying).
Happy to clarify anything, and thanks so much for any help.
Rob
Don't become the victim of user mischief.
Assign a unique ID for each valid response and have the users enter the ID.
Yup...
As you said, you need to do some teaching, here's is the teaching table. Basically just fill up as you go along. You might ask what is UOL, sorry i just crack it out, just for illustration.
And then you have the users inputs (column E), plus 5 calculated columns (F:J)
And now the formulae, I'll show those in row 2 only, the rest are just filled down.
F2 = SUBSTITUTE(E:E," ","*")
G2 = VLOOKUP(E:E,A:B,2,0)
H2 = COUNTIF(A:A,F:F)
I2 = VLOOKUP(F:F,A:B,2,0)
J2 = IFERROR(G2,IF(H2=1,I2,IF(H2=0,"Never seen before","Need validation")))
Basically the logic flow is
do the exact match vlookup of user input in teaching table, if found, then thats it and return the unified name. (Column G)
if the above exact match not found, then we'll proceed to use the star like Helper vallue. Count how many times the HELPER value is found in the teaching table. (Column H)
do the exact match vlookup of helper value in teaching table. (Column I, for use with Column H)
If value in column G is not an error, then use it,
else if value in Column H is 1, then VLOOKUP(HELPER) value is good. If its 0, then you haven't teach excel on the name before. If >2, then it means it need your further attention, the VLOOKUP(Helper) value could be wrong as there are more than one matches.
The trick here is the HELPER column. by replacing blank space with stars, the vlookup now become some sort like vlookup of a sequence of keywords. Doesn't matter how the user's input is, as long as some keywords found and the sequence match, the countif and vlookup return the value.
And at the same time, you also submit an IT enhancement request ! :)

Resources