Returning all values with certain criteria - excel

I need help with creating excel formula. I have a list of names in row 1 and list of values in row 2. I need a formula that would return all of the names from row 1 that has a certain value (lets call it "value1") in row 2. I know how to do that with VBA but I would rather avoid using macros if possible. I'm pretty sure it would be possible with array formulas but I'm not really good with it so I would appreciate a help.

Something like this:
=IFERROR(INDEX($1:$1,AGGREGATE(15,6,COLUMN($A$2:$D$2)/($A$2:$D$2="X"),ROW(1:1))),"")
As it is copied down the selection will change.

Related

Look up multiple values in a list and sort them in a new sheet

I have a data sheet that contains 9 columns corresponding to a name. But the names are repeated. So I want to create new sheets for all names and filter their data from the data sheet. The sheets must be updated when any changes are made on the data sheet.
I tried VLOOKUP but had some various problems, and it didn't work well for me. I've found a way that may help, but it's prepared for Excel. ( https://fiveminutelessons.com/learn-microsoft-excel/use-index-lookup-multiple-values-list )
In OpenOffice ROW(1:1) doesn't give a result. Dragging as an array also doesn't change the cells in the formula. So are there any alternative ways to solve this problem? (OpenOffice solutions are preferred).
The example from the link in the question almost works in LibreOffice. To fix it, instead of ROW(1:1), use ROW($A$1:$A$6).
I am not sure what ROW(1:1) does in Excel, and I could not find an explanation online. In Calc, ROW($A$1:$A$6) returns an array of 1 column x 6 rows: {1;2;3;4;5;6}.
So here is the full formula using the example.
=IF(ISERROR(INDEX($A$2:$C$7,SMALL(IF($A$2:$A$7=$A$9,ROW($A$2:$A$7)),ROW($A$1:$A$6))-1,3)),"",INDEX($A$2:$C$7,SMALL(IF($A$2:$A$7=$A$9,ROW($A$2:$A$7)),ROW($A$1:$A$6))-1,3))
Be sure to enter it as an array formula with Ctrl+Shift+Enter

Using nesting vlookup formulas for use in automation code

I am trying to write a formula that uses different vlookups depending on whether the formulas produce errors or not. I have 3 tabs, each with 3 columns.the first two columns contain values that are in the vlookup, with the third colum containing the value I want to find. Basically i want a formula that will use different vlookups depending on whether the lookup value is found in teh first tab or the second . Below is the formula i am working with. It works to bring in values from Sheet1 into Sheet3, but doesnt work when the values are in Sheet2. Also will be inserting this formula into vba code for automation use.
=IF(OR(ISERROR(VLOOKUP(B2,Sheet1!B2:C19,2,FALSE)),ISBLANK(VLOOKUP(Sheet3!B2,Sheet1!B1:C19,2,FALSE))),IF(OR(ISERROR(VLOOKUP(Sheet3!A2,Sheet1!A1:C19,3,FALSE)),ISBLANK(VLOOKUP(Sheet3!A2,Sheet1!A1:C19,3,FALSE))),IF(OR(ISERROR(VLOOKUP(Sheet3!B2,Sheet2!B1:C21,2,FALSE)),ISBLANK(VLOOKUP(Sheet3!B2,Sheet2!B1:C21,2,FALSE))),IF(OR((ISERROR(VLOOKUP(Sheet3!A2,Sheet2!A1:C21,3,FALSE))),ISBLANK(VLOOKUP(Sheet3!A2,Sheet2!A1:C21,3,FALSE))),"non",VLOOKUP(Sheet3!A2,Sheet2!A1:C21,3,FALSE)),VLOOKUP(Sheet3!B2,Sheet2!B1:C21,2,FALSE)),VLOOKUP(Sheet3!A2,Sheet1!A1:C19,3,FALSE)),VLOOKUP(Sheet3!B2,Sheet1!B1:C19,2,FALSE))
it returns the value sI am looking for up until the lookup values start occuring in Sheet2. At that point it shows me "non".
Any help would be greatly appreciated! Thanks
Your first VLOOKUP does not reference "Sheet3".
I think The below equation does what you are looking to do (assumes you are on Sheet3).
=IF(IFERROR(VLOOKUP($B$1,Sheet1!A:C,3,FALSE),"")="",IF(IFERROR(VLOOKUP($B$1,Sheet1!B:C,2,FALSE),"")="",IF(IFERROR(VLOOKUP($B$2,Sheet2!B:C,2,FALSE),"")="",IF(IFERROR(VLOOKUP($B$2,Sheet2!A:C,3,FALSE),"")="","nan",VLOOKUP($B$2,Sheet2!A:C,3,FALSE)),VLOOKUP($B$2,Sheet2!B:C,2,FALSE)),VLOOKUP($B$1,Sheet1!B:C,2,FALSE)),VLOOKUP($B$1,Sheet1!A:C,3,FALSE))

How to get a column which contains a particular data in a row excel

This is probably very easy for experienced user of excel, but I couldn't find a way to do this, so I asking this question.
I have particular range of cells, let's say E5:M5, only one cell of this range will contain 1, other will contain 0. I want to reference, first cell of that column (which contains label). I want to do this by using a formula in another cell. In the end, that another cell should have label name as its value.
I wanted to post image elaborating what I want, but it seems I can't do that.
Anyway, can anyone tell me how this can be done?
I'm going to assume you want to use a formula rather than VBA as it is not recommended for inexperienced Excel users to use VBA. Use this formula to determine the first column out of your set, which has "1" as a value:
=match(1,E5:M5,0)
If by 'label name' you mean you have a header or something (let's assume in row 4), you can use the index function to pull the value from the mirror set of rows above the match function, like so:
=index(E4:M4,match(1,E5:M5,0))

Excel sum range & next set of range numbers

Trying to do something which I think is quite easy but I cant figure it out.
I have a row of about 1000 items. I want to sum for items (A1:H1) and then (I1:Q1) and so on until I get to the end. When I try to do (A1:H1) and drag the formula button across it then gives me (B1:I1). Im trying to avoid this.
Thanks!
Slightly convoluted but the below should work for you. You will need to add in the names of your sheet instead of "Sheet1", it essentially works off of the column reference of the cell the formula is placed into, I had it starting in column A.
=SUM(INDIRECT("'Sheet1'!"&ADDRESS(1,(((COLUMN()-1)*8)+1))&":"&ADDRESS(1,(COLUMN()*8),1,1)))

Excel formula to prevent duplicate name entries

I am creating a work chart for a project with excel table. However with so many people to manage I have ran into an issue of often putting same person twice on different columns of the same row (he/she can't work on two places at same time!)
So, I am looking for help with a formula that notices if the same name appears twice on a row but does not count multiple blank cells as duplicates. My understanding of excel is very basic and so far I have managed to get this far
=COUNTIF(A6:W6;A6:W6)=1
which returns to me with false, which I assume is because of the blank, unfilled cells still within the table being counted as duplicates.
Help would be appreciated, thanks.
You can't have a range as the second argument of a Countif. The range you pass into the formula will resolve to just the first value. Use the Evaluate Formula tool to see what I mean.
If you want to determine if ANY name in the range A1:W1 appears more than once (and exclude blanks), you will need a recursive function. That can only be done with VBA, not with a formula.
You could use a Countif in a conditional format to highlight duplicate names in a row. That's a piece of cake. Pipe up if you want to do that.

Resources