I've got a fairly large spreadsheet with survey data that I'm trying to summarize. The first tab of the spreadsheet has all the survey data and I'm trying to summarize on the second tab.
Column A in my second tab will have all the unique store numbers listed. I'd like Column B of the second tab to list the number of times a customer answered "Very Satisfied" in columns R through Z on the first tab for a particular store. The store number is also listed on the first tab in column DY.
I've never tried nesting combining COUNTIF and VLOOKUP before or maybe that's not even the best way to do this. My feeble attempt looks like this
=COUNTIF(Sheet1!DY:DY,VLOOKUP(A2,Sheet1!R:Z,0,FALSE))
And, of course, this returns "#VALUE!". I know I need "Very Satisfied" in there somewhere but I can't wrap my head around the nesting. Any suggestions? Thanks in advance.
Use SUMPRODUCT()
NOTE: I am using full columns here but it would work better if one would limit the references to just the rows that have data.
=SUMPRODUCT((Sheet1!DY:DY=A2)*(Sheet1!R:Z="Very Satisfied"))
Related
I have two columns of words (Old list) and (New list)
I'm trying to check using the VLOOKUP() function both columns and find which words of the New list doesn't appear in the Old list.
(The answers here is obviously: eyes, john, martha, phone)
I'm giving this simple example to know what VLOOKUP() formula to also apply to a larger sample. In reality I have two columns of over 1000 items. Thanks
=FILTER(F2:F10, ISNA(VLOOKUP(F2:F10,A2:A10,1,FALSE)))
This will filter it down and remove all the N/A values while comparing the 2nd list to the first.
EDIT:
as per comment needing clarification (too long to put as a comment)
You can do anything you’d like by substituting references. It’s best to think of the syntax of things here to get a lay of the land and figure out what you want to pull information from.
The ISNA() just handles N/A errors that will occur with partial lists and is irrelevant to understanding where to put your references.
=filter(array, include, [if_empty])
Where “array” is the range you want to filter FROM
And “include” is what you are searching FOR from that range.
The [if_empty] is optional – you can put a text there, like “No Results” in quotes so that it’ll substitute that for N/A.
The “include” portion is where I’ve added additional information because I want to narrow in what I’m including…. In the plain and simple form of =filter() you’d just be putting a word/cell reference you’re looking for. It’ll pull every column for the whole table if there are multiple columns. But we want it to search multiple criteria simultaneously.
=vlookup(lookup_value, table_array, col_index_num,range_lookup)
what you are searching FOR (in this case anything within the table), where you want to look for it (where you are searching FROM), which column to find it in (column 1 in your case), and TRUE/FALSE – exact or approximate matches.
The easiest way to search across multiple sheets is to have the files open, and as you type in the formula bar when you get to each section click and highlight what you want by switching sheets (alt tab). Just pay really close attention to searching FOR versus searching FROM and you can do any combination of comparison you need.
If you would like TRUE/FALSE for each element you can use the following
=ISNUMBER(MATCH(A1,ColumnToSearch,0))
The situation: I have an automatic procedure for gathering data from different input-sheets and presenting in a pivot-friendly format. It appears others are in need of the same data, though they want it formatted slightly differently (and they are not friends with excel). I therefor have a version of my table formatted as they want it (with empty columns where my extract does not contain any data).
The table (both) is one line for each department for each year for each cost/income (from now, cost) category. The raw data contains the cost for each year, though some of the users want it to be cost delta from initial year. I want:
One column for raw cost (X). One column for delta cost (Y). One output column (Z) that contains one of those two values, depending on dropdown selection. The first two columns are situated to the right of the "select with mouse and copy these"-columns, so that I dont need to teach the other users how to select non-adjecent columns :P (just letting u know the level of understanding i have to work with here)
Now the naive approach to this would be to have an if-statement in column Z like this:
=IF(selected_Calc="Use raw cost";[#[X]];[#[Y]])
Alternatively nest more ifs (one for "Use difference to 2019", and potentially add more nesting if more ways to show the value should appear in future)
This works. However, it isnt as elegant as I would like it, and if I indeed end up with more ways to calculate this for other people, it will be a lot of nested ifs.
I was therefore considering something like this:
=INDIRECT("[#["INDEX(mapTab_out;match(selected_Calc;mapTab_in;0))&]]")
But this gives a #ref, and tbh i didn't really expect it to work.
The idea is though: .
Have a range mapTab_in. This has the different selections for the dropdown box.
Have the adjecent range mapTab_out. This has the name of the column (X,Y...) that contains the desired calculation)
Have in column Z a formula for selecting which column's (X,Y...) value is to be displayed in Z
The google-stuff I have found so far all seem interested in using the indirect function from outside the table, and usually want to sum an entire column. I have used this in the past. The "ThisRow" things like using # dont seem to work with indirect though. Any ideas, or have I simply made some beginner-error in my formula?
Assuming it's in the same table, you can take advantage of implicit intersection and simply use:
=INDEX(Tablename,,MATCH(selected_Calc,Tablename[#Headers],0))
where selected_Calc is the name of the column you want back. (You could make that the result of a further INDEX/MATCH if you want to use a lookup table for some reason.)
Thanks for any help here. I've been racking my brain (and searching online I promise) for a while on this one.
I'm looking at columns A and B that have unrelated information, but sometimes the information in columns A and B are duplicates. For example cell A2 says "Frank" and B2 say "1". then cell A3 says "Frank" and B3 says "1". The information is a duplicate across two columns. The rest of the names in this example can be anything, Frank, Sally, Robert, etc.. and the rest of the numbers in column B can be anything (Image of example attached). If the information is a duplicate I'd like to output a reduced list using two new columns.
These functions need to be operable in real time. As data is added the equations must update in real time. I also can't concatenate because I need info to stay in two columns. I've see a lot of examples of doing this for 1 column of data using an array (see example 2), but I don't know how to build one that considers two columns. 1 column example: =IFERROR(INDEX($T$2:$T$9, MATCH(0,COUNTIF($X$1:X3, $T$2:$T$9), 0)),"") Any ideas how to build this out so it works for two columns?
I'd like to avoid using VBA if possible, but if it's the only way so be it. I want to avoid using VBA because a lot of people touch the spreadsheet and it's a lot easier for me to fix a function than code. Gotta love humans!
Thanks so much for your help!
Robby
example example2
The simplest way that I can think of is:
a) Select your data, and paste elsewhere either on same sheet or a new one.
b) Select one of the cells in the copied data
c) Go to the Data menu tab, and click Remove Duplicates
d) Click OK
Create a new column C that concatenates columns A and B. Then remove duplicates on the basis of column C.
https://support.office.com/en-us/article/CONCATENATE-function-8F8AE884-2CA8-4F7A-B093-75D702BEA31D
I'm working on a sensitive Excel file where I'm not allowed any VBA code, so I have to help myself with basic formulas in Excel. Please note that I am not allowed to add extra columns and the solution has to be in one single cell. What I have are two columns:
Column A has numbers from 1-10.
Column B has numbers from 1-10.
I'd like to know e.g. for all 3's in A, how many 5's are in B.
The result would be as well seen with the use of two filters, but I don't want to do this over and over again, since the size of the columns will only get bigger.
I tried to use INDEX-MATCH command in the COUNTIF, but it's not that simple. The main problem is to define how to look and search in each row and then count/sum/whatever.
Does anyone have any ideas?
Though a function not available in versions of Excel before 2007, it seems:
=COUNTIFS(A:A,3,B:B,5)
met the requirement here.
i have a little problem with final formulas in one of my column. How to start. maybe i will explain what i have a then what i want.
i have an excel worksheet with 3 sheets. i want to record goods and what are these goods made of. first is sheet called Goods where is possible to put number of goods i want to make. In this case i want to make 1x sandwich1 and at the same time 3x sandwich2. i dont want make sandwich3 this time.
Second sheet is Matrix sheet where I record every good and what it is made of. This sheet is basic sheet and all other sheets take list of goods (resp. ingredients) from this sheet. Simply when i want to make sandwich1 i look at matrix and know that i need 1x1pc of egg + 1x5g of cheese. And for 3x sandwiche2 i need 3x10g of sausages.
Final sheet is called Ingredients. It is a list of used ingredients from Matrix sheet (exactly same order) to make these sandwiches. I want to fill formulas into column B which would go through one ingredient ofter ingredient and count needed amount of it. So it would look into matrix in the same row and where there is some number it would multiply with number of items from Goods sheet. The list of goods is also in the same order as in the matrix sheet.
I hope you understand now what i want and will try to help me. I think there will be SUMPRODUCT, SUMIF and maybe INDERECT functions but i am not that skilled in excel
thanks for any suggestions
You can use MMULT function here - it's an "array formula" which you need to enter in a range. You can do that like this:
In Ingredients worksheet enter this formula in B2
=MMULT(Matrix!C2:E4+0;Goods!B2:B4+0)
[I'm assuming you have a European version of Excel where ; is used to separate arguments]
Now select the whole range B2:B4, press F2 key to select formula and hold down CTRL and SHIFT keys and press ENTER. This "array enters" the formula in the range and you should now see curly braces like { and } around the formula and also the correct results.
You cannot change part of that array now, only the whole thing
Note that I'm assuming that the contents of Goods!A2:A4 will be the same as Matrix!C1:E1 and in the same order. You can extend the ranges to be as large as you like as long as that principle still holds
I suspect that this is an issue of "when all you have is a hammer, every problem is a nail". For reasons known only to you you are using a spreadsheet to solve a problem that databases were made to do. Any solution to this problem in a spreadsheet will be entirely dependent on the integrity of your data - add another column or get things out of order and it will fail.
That said, what you have in your link is effectively a pivot table and what you need is the unpivoted version of this - the instructions for getting this are here.
When you have that, you can use the various database functions in excel to get your answer.