Excel 365: COUNTIFS with range as a criteria to lookup - excel

[as per the comments, I am happy to provide a minimal example of the problem if someone can tell me how to upload excel to stack overflow!]
I had a look at previous answers, but nothing seems to fit. Once answer nearly did, but I can't adapt it. Trying to steer clear of VBA but please tell me if needs must.
Basically, I have a large-ish sheet of incident tickets. Some are logged by company A, and some by company B. Unfortunately, the only way to tell which company has logged which ticket is to search in another table on name. What I am trying to do is count tickets that match certain criteria that were logged by, let's say, company B - I have the list of people at company B in a worksheet in the workbook
Obviously, COUNTIFS seems to be the obvious answer, except I can't seem to get a sensible answer from COUNTIFS. :) So, I can get a perfect number of tickets for this or that criterion, but I am unable to add that the ticket should be from company B only, ie: I need a COUNTIFS('Ticket'!$D:$D,'CoBPeople'!$N:$N) term, and I don't see how that's possible to include. In VB, I would know which thing I am iterating over and check each time (inefficient, I know, but we're talking thousands here, not millions!) and just add them up, but it doesn't seem to be possible to get COUNTIFS to "lookup" each name it finds as it does its thing.
Any ideas? I just feels like there is an obvious answer I am missing...
Thanks in advance!
MrBB.

I was hoping to be able to do tis without modifying the ticket dump, but adding a column that checks which company a person works for does look like that's the easiest solution.

Related

If excel matches 3 values then return 4th

This is my first time posting on any website, so please be gentle lol!
I am trying to figure out what forumula i need to help with the attached tabs;
Main Sheet
Data Dump
Goal: to identify how many blocks are due for each block length, at each selected time for each service type. The current UI we have is really poor. this is more user friendly.
My solution?
in each cell there will be a formula to search each time slot for each service type and return the accepted amount for standard/large vehicles from the data dump CSV.
I'm self taught on excel and know some basic macros and formulas however i have admitted defeat here.
I hope this makes sense. I only need the formula to pick up one service type i can amend to suit where necessary.
Thanks in advance for those who take the time to assist.
Edit - Outcome
datadump2
James

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.

Return most common value in a list based on criterion

I found a similar question here (Return the count of the most frequently occurring string based on multiple criteria) but did not see a satisfactory answer. Please help if you can!
I have a list of Manufacturers and their products:
Manf.......Product..........Metric
Adobe......Photoshop.....User
Adobe......Acrobat.........User
Microsoft..Office............Device
Microsoft..Access.........Device
Microsoft..MSDN..........MSDN Named User
In another table I have a list of unique Manufacturer names, and I need to be able to say what the most common (and then second most common, hopefully) metric per manufacturer is, as below.
Manf.........Most Common Metric
Adobe.......User
Microsoft...Device
I would prefer not to have a VBA solution in this case, but will use if necessary. I have seem some INDEX MATCH attempts but nothing is working quite right yet. Thank you!
EDIT: I thought of another way to search for answers and found this, which worked! http://answers.microsoft.com/en-us/office/forum/office_2010-excel/formula-to-return-most-common-value/06383764-3c7d-e011-9b4b-68b599b31bf5?auth=1
Anyone know how to modify it to find the second and third most common values?
If I understand the requirement, a PivotTable should show you what you want:
This is in Tabular form without Totals and without Subtotals but with 'Metric' sorted Descending by Count of Metric. Repeat items labels is not checked as this may help with identifying where 'most common' starts for each Manf.

How do I fix this Query in my Google Document?

Could not really find much on this issue, and I even had my father, who works with excel all the time, walk away stumped on this one. Hoping you guys could shed some light!
Here is a copy of the document: https://docs.google.com/spreadsheets/d/1dH86E1hZRQMj3UL6n4B81IVEkHS5_djkXhHkOl3LOSE/edit?usp=sharing
So this was made for my Runescape clan for us to determine when users require a promotion; it simply makes things easier for us. I'm pulling the data with IMPORTHTML from a site that already tracks the data, my document just arranges it for our personal use (promotions).
On the right should be a list of just people that need the promotion, however, it seems whoever is first on the column I select with the QUERY (A2:D501, Pea being A2), they get put there regardless if they meet the criteria. In this case, under "General Promotions", they need a Clan XP of 250,000,000 and they must be a Captain rank (it goes Captain -> General), yet the Owner (both under 250m exp and not a Captain), is showing up there and under all categories.
Have no idea why this is happening, so if anyone could enlighten me, I would be greatly appreciative!
All I want is if there are no users who fit the criteria, I can have it say something like "No Promotions Yet". Couldn't figure that one out either.
Does this formula work as you want in cell F3:
=IFERROR(QUERY(A2:D501, "select A,B,D where D >= 250000000 and B contains 'Captain'"),"No Promotions Yet")
You will need to delete the formula you have in columns G & H though - QUERY can output multiple columns rather than needing a separate formula for each one.

Building a customized, fuzzy and multiple Vlookup

Ok so, twice a month I receive a large file of about 100 rows, which contains 4 columns:
Building name - value - county - state
I´ve to complete 2 other columns based on a master list that have thousands of entries.
I want to produce something very similar to this fabulous add-in (http://www.microsoft.com/en-us/download/details.aspx?id=15011), but a bit simpler and that I could use at work without problems.
What I need to do is the following:
In order to match my input with the master file, I know the county and state must match, but then, the building names can change a bit in each file for the same building (ie "John Miller #34" can be "Miller, John 34 A"), and that the values may vary but not too much.
Based on that, I want to bring from the master to my file, all the entries that may match each of my rows, filtering by County and State first, and then by similarity in name and value.
Could you please share your thoughts on how you´d approach this?
I know this is not a simple thing, but anything may help!
You could also use wildcards to try and match on the primary identifier within the name. from your example, that might be "Miller", for example.
Unfortunately for you, the vlookup "fuzzy logic" is nowhere near reliable for your purpose (see the comment on my answer below for details), and you won't have any indicator as to whether the returned result is accurate or not.
It's possible to get 100% of what you want through some heavy coding in a user-defined function, but this is probably well beyond your comfort zone.
A clunky solution, although somewhat easy to explain and adopt, is to create an "identity column" for every unique scenario that can occur. So, for example:
Then you can import your master sheet and add the same identity column to the left, and perform your vlookup. When a new configuration is added you can just add that to the master list and it will populate in your imported file in future instances.
That said, if you are interested in learning, there have been many people who have walked in your shows and felt your pain. You may want to indulge in this:
http://www.mrexcel.com/forum/excel-questions/195635-fuzzy-matching-new-version-plus-explanation.html
Because what you are truly requesting is an algorithm. It's not a simple thing, but it's very possible. And if you take the time to learn you not only solve your immediate problem, but make yourself marketable as an Excel wiz. Good luck!

Resources