Count cell(s) if another cell shows certain data - excel

I am struggling work out the formula/function that I should be using for an excel spread sheet I have created.
A questionnaire is being sent out to clients asking for feedback of their recent business. I have one work sheet which will allow me to input the answers for each client and another showing the results.
I would like the results to be shown as a whole group and (using a drop down menu) for each sales adviser.
I have created the drop down menu and I am using the function 'Counta' to obviously count the number of 'yes's or no's etc. for each question.
The problem I have though is when trying to show the results for individual sales advisers I can't figure out which formula/function I should be using.
I have come up with the following:
{=IF(H1=Data!B3:B500,COUNTA(Data!$D$3:$D$500),"0")}
Where:
H1 = the drop down menu with the list of sales advisers.
Data!B3:B500 = the 'Adviser_names'.
Data!D3:D500 = the results for that inidivdual question.
The problem is I can't get the two columns to match each other in the results - i.e. if Data!B3 is the same as H1 then count Data!D3 ONLY; or/and (plus) if Data!B30 is the same as H1 then count Data!D30 only.

Use simply:
=COUNTIFs(Data!B3:B500,H1,Data!$D$3:$D$500,"<>")

Related

Excel XLOOKUP / FILTER Function Unable to Use in Data Validation Drop Down List

I am truly stumped and believe I'm looking at the cliff of what excel is simply incapable of in its current state. I am hoping that one of you geniuses can prove me wrong.
Here's my situation. I have thousands of items that need to be sorted by 5+ parameters. The best way I can think to do this is to have one drop down list populate the next drop down list.
For instance;
A user would select the first drop down list and choose a given item.
1. ITEM
From that item chosen, the next drop down list would populate to only show the various model numbers for that item.
2. MODEL
I currently have this part working using an XLOOKUP embedded in a data validation list.
=XLOOKUP(Item Input Cell, Item Column, Model Number Column)
After this point. I want XLOOKUP to continue to automatically populate these lists.
3. MATERIAL
4. CAPACITY
5. VENDOR
6. PRICE
From the chosen item & model, then materials that match both item & model display in a drop down. Capacities that match 1,2,3 have a drop down, vendors that match 1,2,3,4 have a drop down, and finally displaying all possible prices for that input in a drop down.
My problem is that I can not seem to figure out how to use XLOOKUP sorting by 2+ criteria successfully in a data validation list. I get the "There's a problem with this formula" error box.
I have scoured the internet for others encountering this problem, but nothing seems quite 1 to 1 to what I am working with. I am unable to have an independent table on this specific excel sheet to then populate the data validation list for every single permutation so that's out.
For list 3, I have tried using
=XLOOKUP((ItemInputCell & ModelInputCell),(ItemColumn & ModelColumn),MaterialColumn)
this does not work and leads to the aforementioned error box.
FILTER does work when it's in a regular cell, but is unable to function in a data validation list (?) apparently. Which is truthfully aggravating as it's functioning perfectly otherwise.
I am hoping that one of you can see some novice mistake and correct my ways OR if I have reached the cliff I mentioned, what is another method of doing this?

multiple lines made into 1 line of data

I have attached a picture of what im trying to do.
I run these reports on my techs once a week. on the left side of the picture it shows the service order number multiple times and then the the booked date and closed date the techs id number actual hours work and then sold hours. the problem is it has many lines with the same service order. i need to make it look like the line to the right. 1 usable line of data so that i can process the reports the way i need to.
Copy A1:E32 all your Data without column F and paste it in I1 it will be I1:M32 for example, select I1:M32 the new Data under Data Tab click on Remove Duplicates you will have one row for each different entry
If the Number in Ro-no (column I) is unique for each entry, use the following in N2:
=Sumif($A$2:$A$32,I2,$F$2:$F$32)
and drag it down
It will sum the Sold Hours in column F for each RO-NO
Change the references to include all your rows and keep $
Power query
One of solutions is to use MS power query addin. In Office 2016 and alike the PQ is built-in feature, located on the Data tab, Get and Transform group.
Let's say we have data like this:
We can use the Power query to Group By, like so:
The query will remember the steps you 'teach' it.

Relabeling Duplicates in Excel of Cells in direct proximity

Apologies for the tile gore - was trying to be descriptive.
I have a large lab result data set, and it has been found that one analyte was screened for twice per sample and i need to capture both sets of results. This results in me having a table similar to below where Antimony is listed twice. Is there a way to automate something either to flag the instances where i have two rows like that or rename to antimony-1 and antimony-2? Since I have 300 sites screened for the same things, everything shows up as duplicate and i can't use the simple methods. The main trigger is the proximity to another row where everything is matching except the results.
If I assume you have the data in you screen shot starting in cell A1 (and Soil as your site) I'd add to columns the first combines Site & Element (Column F in my example):
=A1&C1
Result: SoilAluminium
In the column next to that I'd have a formula:
=F1&COUNTIF($F$1:F1,F1)
Result - SoilAluminium1, SoilAntimony1, SoilAntimony2 etc
Note: Pay Attention to the $'s
I hope that works

Excel to auto-remove duplicates before sum in CSV based on URL-paramter

I am using Really Simple Traffic Logger to store Date, Timestamp, IP and visited site by users on my website. Each user visiting the website is assigned a UID by a parameter in the URL in the form of:
http://www.domain.com/site.php?=dTM_c1_uid7
dTM = customer,
c1 = category 1,
uid7 = uid for person 7
The csv file stored contains the following:
"DATE","TIME","IP","LOOKING_FOR"
"2016-05-22","07:30:40","XX.XX.XX.XX","/site.php?=dTM_c1_uid7"
"2016-05-22","07:31:10","XX.XX.XX.XX","/site.php?=dTM_c1_uid7"
"2016-05-22","07:31:19","XX.XX.XX.XX","/site.php?=dTM_c1_uid8"
the information is stored in a CSV-file, where I am attempting to sum the results of the data, which is to be visualized by another script in real-time. However, as many of the visitors are the same people visiting the website more than once, I would like to remove these based on the UID parameter in the URL, before calculating the sum, so each count (hit) can be calculated as unique hits.
I am therefore trying to work out a formula for auto-removing duplicates that contains the "_uid7" parameter, before calculating the sum.
Is there a smart method for constructing a formula in excel that can do that automatically?
Thank you.
Supposing your data starts from A1 Please post the following formula in B1and fill down the column B with data in column A
=TRIM(SUBSTITUTE(MID(A1,(SEARCH("dTM_c1_",A1,1)+7),99),CHAR(34),REPT(CHAR(32),99)))
You will get uid7, uid8 etc which can be counted or other processing can be done.
EDIT
Based on your comments and taking "dTM_c1_uidnn.." string counts of occurrence is shown in the following snapshots. I have shown two snap shots out of which one hides the helper column.
This is the best I could do at the moment. Column B can be filtered either with Excel native Remove Duplicates OR by a VBA routine. Finding unique values of numerical values is comparatively easy using Frequency Function But somehow after repeated attempts despite following some tutorials, I could not get the desired results for text strings. I would appreciate your feedback positive or negative. My efforts would continue to find the most optimal solution.

Break-Down Data in Excel without VBA (Formula Only)

Many times, I am required to provide some type of break-down to the customers - an example is shown in the attached figure.
I have a table of data ("TABLE DATA" - which is some type of pivot) + Customer provides its official form, its structure must be preserved (highlighted in yellow ). Basically, I need to separate the cost details of CODE "A" and CODE "B" into 2 separated sections.
Customer requires me to provided details for each individual Part (example shows Part A - "Break-Down Part A)
Is there anyway to put a"ITEM" from "TABLE DATA" into Code A and Code B ? the rests can be solved by Vlookup (Price, Quantity) - note: "ITEM" is non-duplicated values . Thank you very much
Number your rows in the breakout using =1 and =A1+1 and then just use the formula ="B-ITEM"&TEXT(A1,"000"). If you want to skip making a counter column you could use ="B-ITEM"&TEXT(ROW()-1,"000") to just use the current row number (minus 1 or however many you need).
If your items aren't sequentially like that, but still unique, I would recommend adding counters on the original tab similar to what you have, which would let you quickly find the 5th A or 7th B, something that counts the previous instances of your current type, and then adds 1. For Row 6 you could do =COUNTIF(A$1:A5,A6)+1.

Resources