Multiple Values using single Criteria - excel

I need help with my office work.
I am trying to look for a formula where I have one database that contains the list of all supervisors and all their analyst (15 per team).
I have tried
=IFERROR(INDEX(Database!$A$1:$A$350,SMALL(IF($F$7=Database!$I$1:$I$350,ROW(Database!$A$1:$A$350)-1,""),ROW()-1)),"")
What I am trying to do is I want to do a lookup using the supervisors list and employee id list and it will show all their emp id on the yellow part.
I have updated a screenshot of the idea,

If your data is been set up in two columns, you might look into use of SMALL. It's an array solution though:
Google Spreadsheets:
Formula in C2:
=ARRAYFORMULA(INDEX($F$1:$F$27,SMALL(($G$1:$G$27=$C$1)*ROW($G$1:$G$27),COUNTIF($G$1:$G$27,"<>"&C$1)+ROW(A1))))
Excel:
Same formula (almost) but entered as array using CtrlShiftEnter:
=INDEX($F$1:$F$27,SMALL(($G$1:$G$27=$C$1)*ROW($G$1:$G$27),COUNTIF($G$1:$G$27,"<>"&C$1)+ROW(A1)))
You can replicate the formula for C17 but just need to edit the cell reference to C17. Drag the formula down.

So, have a look at this:
(Note, submitted before the source data structure was evident, but left as it may be a helpful solution for others...)
Cell B2 is a drop down from data validation to select the supervisor you want to work with.
Drag the choose down for the number you need.

paste in C2 cell:
=FILTER(F:F, G:G=C1)
paste in C17 cell:
=FILTER(F:F, G:G=C16)
also you could just use:
=FILTER(F:F, G:G=INDIRECT("C"&ROW()-1))

Related

How to filter and add together one column using the information of another column, which I need to find using a cell

Basically, I want to filter, and then add together, one column('Essay Sentences'!H6:H1400) using the information of another column, which I need to find using a cell(A2).
For example, I have the column 0011c ‘Essay Sentences’!H6:H1400 and I want to add together only the 0011c’s that also have at least one 0012a. But I only get the “0012a” column from searching for it with cell A2.
A2 could be anything from the header 'Essay Sentences'!F4:AZ4, so I need the formula to look for any column under these headers.
Also, I need to use the FILTER() and SUM() functions.
Here's what I got so far:
=SUM(FILTER('Essay Sentences’!H6:H1400, INDEX('Essay Sentences'!F4:AZ1400, 0, MATCH(A2, 'Essay Sentences'!F4:AZ4, 0)) > 0))
Link to Source Data1
Link to Source Data2
A mock up example as below:
Please see below solution using SUMPRODUCT based on your mock-up example.
The following formula is in Cell C10 in my solution. You cannot drag it across board as it has been hard-coded to specific named ranges. Use INDIRECT for more flexibility if needed.
=SUMPRODUCT(FRUITS*(SNACKS>0)) or =SUMPRODUCT(INDIRECT($A10)*(INDIRECT(B$9)>0))
The three formulas are essentially the same depends on if you prefer to use Named Ranges (eg. FRUIT stands for cell B2:B5) or actual ranges (eg. B2:B5) in the formula.
Using INDIRECT enables you to drag the formula across board but the trade off is that it will slow down the calculation. If you are only comparing one column with another, just use the Name or the actual range in the formula.

what formula is needed to count two specific cells that already include a formula

Afternoon all,
I am trying to create an enquiry managment spreadsheet that records all incoming enquires and what has been done to date.
I am trying to get a cell to count how many "New" enquiries David has.
Daivds name is populated via a drop down list and the number of enquiries is counted via the text "NEW" selected from a drop down list.
The formula as I understand it should be along the lines of
=COUNTIF(Enquiries!E4:E309,"NEW")=IF(Enquiries!B4:B309,"DAVID")
But i cannot for the life of me get it to work!!
You should use the formula COUNTIFS() which allows to place more than one condition to do the count. As mentioned in the comments by BigBen, the formula should be as follows:
=COUNTIFS(Enquiries!E4:E309,"NEW",Enquiries!B4:B309,"DAVID")
If you want to use the formula for different people, which i guess you want, you can change "DAVID" for cell E$2, and block the cells by using $ symbol, so the formula would be like:
=COUNTIFS(Enquiries!$E$4:$E$309,"NEW",Enquiries!$B$4:$B$309,E$2)
and then drag the formula horizontally.
You can find more help about the formula on this link

Pull from List Excel

I have a set list that is frequently changed. Example shown below:
A1 AEZS
A2 AEMD
A3 EARS
A4 BCT
A5 BSTG
A6 CHFS
A7 BPMX
A8 ABCD
A9 ZERNA
A10 APPL
I want to extract from this list to pull the words that start with the letter "A", and make it into another list. From my research, I'm aware that using the following function.
Below is the end result I would like to do (C column is arbitrary):
C1 AEZS
C2 AEMD
C3 ABCD
C4 APPL
How can I do this?
I'm aware that using the formula =IF(LEFT("A",1)....etc is probably a good start. But I am new to Excel, and I am not too familiar to working with it. Additionally, I would like to be able to keep the cells in their each row (as in not all into one cell)
You can use an array formula (entered with CTRL+SHIFT+ENTER).
If your info (AEZS, AEMD, etc.) is in column A, starting row 1, you can put this in say B1 and drag down:
=INDEX($A$1:$A$10,SMALL(IF(LEFT($A$1:$A$10,1)="A",ROW($A$1:$A$10)-ROW(A$1)+1),ROWS(A$1:A1)))
Then, to hide errors, just wrap IFERROR([above formula],"") around it.
You can avoid using Array formulas by using the AGGREGATE function. It might also be handy to put the "starting letter" in a cell so it can be changed. For example, with your data in myRange in column A and the starting letters in the first row,
B2: =IFERROR(INDEX(myRange,AGGREGATE(15,6,1/1/(LEFT(myRange)= B$1)*ROW(myRange),ROWS($1:1))),"")
Select B2 and fill across as far as needed (eg to Bn)
Then select B2:Bn and fill down as far as needed.
To understand how this is working, I suggest you use Excel's built-in HELP feature, and also the formula evaluator tool.
And, of course, if this does not need to be dynamic, you can always use a simple or advanced filter. Again, these are well explained in HELP.
Advance Filter offers something of the capability, though is not dynamic:
Add a label to ColumnA and a criterion in A2:
="=A*"
Then DATA > Sort & Filter, Advanced and select Copy to another location, select ColumnA for List range:, A1:A2 for Criteria range: and Copy to: wherever suits.
Advance Filter remembers those settings (except, strangely, Copy to another location) so if the contents of ColumnA change it is only a few clicks to call up Advanced Filter again, select Copy ... and OK.

Excel Choosing Column based on filter criteria of other column

Name Skill
Mike Engineer
Salom Doctor
Riku Labour
Sindu Engineer
We need to select who all are engineers or doctors
Use COUNT and SEARCH. If D2 is the cell you're searching in then:
=COUNT(SEARCH({"Doctor","Engineer"},D2))
Drag this formula downwards to apply to all rows.
Edit: As you now mentioned that you want to print the names in the Result column, combine the above formula with IF like this:
=IF(COUNT(SEARCH({"Doctor","Engineer"},D2)),C2,"")
where D2 is the cell that you're searching in and C2 is the cell that you want in the result cell if Doctor or Engineer exists in the cell D2. Dragging the formula downwards to apply to all rows gives:
You should accept #SardarUsama's solution as answer because it answers your actual question. If your requirement changes/extends or you were not able to put your question correctly to others then it is advisable that you accept the provided solution and then ask new question instead of making people change answer number of times.
Now, coming to your question (as per comment shared between you and #SardarUsama's) following might be helpful.
Enter the following formula in Cell C2
=IFERROR(INDEX($A$2:$A$10, SMALL(IF(($B$2:$B$10="Engineer")+($B$2:$B$10="Doctor"), ROW($A$2:$A$10)-1, ""), COLUMN(B$1)-COLUMN($A$1))),"")
This is an array formula so commit it by pressing Ctrl+Shift+Enter
Or else you can use another array formula
=IFERROR(INDEX($A$2:$A$10, SMALL(IF($B$2:$B$10={"Engineer","Doctor"}, ROW($A$2:$A$10)-1, ""), COLUMN(C$1)-COLUMN($B$1))),"")
Drag/Copy across as required. See image for reference.

EXCEL - Find category by searching keyword from other worksheet

I want to get sales by category (states).
In Sheet1, there're state's names in row A (A1 to A6) and cities in the column.
Each cities belongs to states,
e.g.
Sydney belongs to NSW, and Melbourne & Geelong belong to VIC.
Then Sheet2 contains sales data like shown below.
I want to calculate sales by state each month.
At the moment, each cells between row D and row I has a formula like below;
(e.g. F5)
=IF(AND(ISERR(SEARCH("Brisbane",B5)),ISERR(SEARCH("Gold Coast",B5)),ISERR(SEARCH("Cairns",B5))),"",C5)
But I'm sure there would be better and more simple nifty way to do this. As shops increase, this current formula gets more complicated. So it's needed to be optimized.
I would like to make these calculation simple using vlookup or something.. but no luck so far.
Any advice, detailed if possible, would be greatly appreciated! Thank you in advance :)
You can do this with an array formula. For example, in D3 use:
=IFERROR(IF(INDIRECT("Sheet1!A"&MAX(IF(ISERROR(SEARCH("*"&Sheet1!$B$1:$D$6&"*",$B3))+(Sheet1!$B$1:$D$6=""),0,ROW(Sheet1!$B$1:$D$6))))=D$1,$C3,""),"Not found")
(To enter an array formula, you need to press Ctrl+Shift+Enter)
The SEARCH looks at the store name in B3 and compares it to all names in Sheet1!B1:D6 with a * wildcard before and after. This won't be an error if it matches.
Adding the +(Sheet1!$B$1:$D$6="") gives an OR the cell is blank (otherwise ** would match).
If it isn't an error, we'll get the ROW of the corresponding match and we take the highest (MAX) row match.
We then use INDIRECT to get the cell value in column A of Sheet1 (the State code) and compare that to the state in the top row of our column
This is wrapped in an IFERROR to tell us if our store doesn't match any city
Array formulas are a great tool, but a little confusing! Rather than work on a single cell, array formulas work on each cell of an array. Typically this is for counts, sums, averages, etc. By including “logic maths”, you can do some really strange things in a single formula. A good resource is [link]http://www.cpearson.com/excel/arrayformulas.aspx Always remember to use Ctrl+Shift+Enter or really strange things will happen!

Resources