Count categories changes in Excel - 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.

Related

Creating keys/unique values for rows

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))

Excel match multiple records from timetable

I just stuck with my school homework, it seems easy, but there is always different errors and mistakes.
Context
All I need is to connect information from 3 pages.
The first one is timetable of trainings.
The second page is "groups"
Players page
Question
1) Here is my first question. How I can put the time from the "timetable" page ?
I tried vlookup with the easiest group "children 5-7" but even this doesnt work.
The problem is that there is many possible times of some groups and I need the answer like "17:00, 18:00 etc" then.
2) The second question is with the page "players".
Firstly I need to match group or coach from page "groups". For children all is simple, but excel dont want to work even with this. But, there is one problem more. In adult group there cant be more than 4 players in one group, that why I have TK1, TK2, TK3 and TK4 - all this are for adult A. and TK11, TK22 etc are for adult B. So when its done we should match court and time from page "groups".
There is my spreadsheet so be free to try it right here. Hope you will help me!
Ref
https://docs.google.com/spreadsheets/d/1PNp60xmHOx_Q1wBc33WrzIaWmeNG5UMhi-4roV7dJXU/edit#gid=1868650910
I try to give you some ideas about how to solve your issues
Question 1:
The issue you have with VLOOKUP is that you cannot search on the left of your lookup value in the reference table. As suggested above by BruceWayne, you may use INDEX/MATCH. Considering the structure of your data a good formula could be:
=INDEX('timetable try here'!B:G,MATCH(A2,CHOOSE(B2,'timetable try here'!C:C,'timetable try here'!D:D,'timetable try here'!E:E,'timetable try here'!F:F,'timetable try here'!G:G),0),1)
In fact I am using CHOOSE() to select the column where your case should match, because your courts are numbers from 1 to 5. You may replace this formula in the column D under the label Time in your sheet named "groups try here". By the way the result that you get is only the first occurrence (in case you see a zero with some decimals figures, remind to change format to hours), so you will not be able to get the list as you like. As far as I know Excel does not have such kind of formulas. What you could do is create a VBA formula by yourself. You can find more details in this other post always here in StackOverflow, where I replied to a similar question with some code. I believe that your case is exactly the same.
Question 2
In this part I just added the last argument to the VLOOKUP and your formula works. So the correct formula should be in cell E2 of "players try here":
=VLOOKUP(D2,'groups dont try here'!A2:C15,3,0)
and in cell F2 (Court) of the same sheet:
=VLOOKUP(D2,'groups dont try here'!A2:C15,2,0)
I believe you need also a formula to pick-up the time in cell G2 (time):
=VLOOKUP(D2,'groups dont try here'!A2:D15,4,0)
These formulas of course works with suitable groups starting with "children". For the others it is not very clear to me what you need. If you have grouped all TK in Adult A and Adult B you need to have some criteria to fill in the other cells from your sheet 'groups dont try here'. Also remind that if you recode the TK1 and TK2 (for instance by adding a new column to be used as key for the VLOOKUP), with VLOOKUP you will always pick up only the first occurrence in the table.
If you need more support, please leave a comment.

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 ! :)

microsoft excel counting word based on condition and matcting

in column A there are some name like a,b,c,d (almost thousand) and in column B there are value either x/X or nothing.
now i want to count for name a how many x/X he has. note that may be user will use x or X(capital)
is it possible to use function. i tried this one SUM(IF(FREQUENCY(A1:A18,A1:A17)>0,(b1:b17=x or X )*1,0)) but not working. can any one guide me?
Sort the data see here and then apply SubTotals see here
EDIT
If you need to do it in code, the rudiments of the approach (using a different example can be found here.

Excel: How to display more information when using Subtotals?

I am looking for a way to show additional information (columns) when doing subtotals beyond the columns that you are using On Change and are doing a function to (sum, min etc).
A simple example, I have the following data, which has 5 columns of information:
Zip Code Media Sunday Zip Code Circulation
3082 Bluebell 3,456,284 551
4418 SuperCoups 632,161 1,437
3221 AJ Direct 6,777,636 1,015
3240 AJ Direct 6,777,636 554
3768 AJ Direct 6,777,636 712
3774 AJ Direct 6,777,636 824
4219 Target Marketing 7,256,964 655
4418 Target Marketing 7,256,964 703
4434 Target Marketing 7,256,964 506
Normally we would want to use the subtotal feature to sum up the zip code circulation for each Media program. The problem, when we do this, the sub total view only shows the media name, and the summed up zip code circulation. On this summary view, I would also like to show the fields that also do not change, such as the Sunday circulation. Of course we can click on the + field to expand to show the details, but I'm looking for way to show additional columns of data that are not changing on the summary view.
Any idea how to do this?
Can't you just change that sum type for that column to MAX or something like that? If the data for the every row is the same (for your subtotal/summary), then using an aggregate type like that might do what you're looking for.
UPDATE: It looks like there's no front-end way to aggregate two different ways at the same time (MAX on C, SUM on D), so here's what you do:
Create the subtotals as SUM on C and D when B changes
Highlight column C
Do a Find-Replace and replace "SUBTOTAL(9," with "SUBTOTAL(4,"
This will switch the SUM aggregates in that column to be MAX instead, which is what you're looking for. I've asked someone who ought to be an Excel MVP, and he said there's no way to do this without modifying the formula afterwards.
Hope this helps!
Have you tried pivot tables?
You can add columns that contain additional 'formulas' too, using Calculated Fields or Calculated Items.
Bill
The easiest way to achieve this is to concatenate all of the required info into a single cell and use that as your "For each change in" column.
So if Zip Code was in column A, Media in column B and Sunday in column C then you could insert a new column as column A which would push the original three columns over (to B, C and D respectively). If you use this formula in A2:
=B2&" "&C2&" "&D2
and then autofill downwards you should now be able to get the desired info when using subtotals. It doesn't look very good but it's quick and easy
(The real problem is that your data is not normalised)

Resources