Return multiple values from a range - excel

To return a value corresponding to another cell from a range if it matches with a cell, I found Chuff's solution helpful (in
Excel - match data from one range to another and get the value from the cell to the right of the matched data ):
=iferror(vlookup(b31,$f$3:$g$12,2,0),"")
However, if there are more than one cells within the column F which match with b1, the formula returns the value of only one cell from the column G.
Could it be modified so as to attract the value of more than one cell?
Thank you!

To return multiple corresponding Vlookup values you should use this formula: =IFERROR(INDEX($B$2:$B$9,SMALL(IF($E1=$A$2:$A$9,ROW($A$2:$A$9)-ROW($A$2)+1),COLUMN(A1))),"")
Because it it an array formula, please enter it using combination of CTRL+SHIFT+ENTER . For example, if you have you lookup range in A:B column, and lookup values in D column, then please enter formula above to F1 cell, then drag it to the right and to the bottom. You should now see all instances of Vlookup next to the lookup value in D column.
If you have only values which you want to sum in case they correspond to your value in cell B31, then simply use SUMIF formula like this =SUMIF($F$3:$F$10,$B31,$G$3:$G$10) entered in cell C31.

Related

Excel formula to return value if two conditions are matched

I need a formula that can be pasted into cells B2:D5 in the sheet displayed in the image below. The formula should see if the value for the row in column A matches a color in row G and if the value for the column in row 1 matches a animal in row H. For all cells without a two part match it should return a blank "". If there is a two way match then it returns the numerical value in column I
Put this formula in B2, then copy across and down:
=IF(SUMIFS($I$2:$I$7,$G$2:$G$7,$A2,$H$2:$H$7,B$1)=0,"",SUMIFS($I$2:$I$7,$G$2:$G$7,$A2,$H$2:$H$7,B$1))

Referencing parameter lookup_array in function match in excel

I want to use the match function in Excel the following way: match(True, D2:J2>=K1,0), to find the smallest value that is greater than or equal to lookup_value. My problem is how to change the row number in the array, since the row number is on his part the result of a match function.
Thanks for the help in advance!
Your baseline formula is:
=MATCH(TRUE,D2:K2>=K1,0)
which looks at row #2:
To change that row, lets put 7 in cell A1 to mean use row #7. We change the formula to:
=MATCH(TRUE,INDEX(D:D,A1):INDEX(K:K,A1)>=K1,0)
So the value in A1 defines the row that MATCH() should use.
EDIT#1:
Here is another example of using INDEX() to return a cell reference.
Say we have data in column A. We want the user to be able to select parts of the column (start and stop rows) and sum the part. However, we don't want the user to tinker with the formula. In fact we are going to lock the formula cell so the user can't destroy the formula. We tell the user to put the start row in D1 and the end row in D2.
We put the formula in cell D3:
=SUM(INDEX(A:A,D1):INDEX(A:A,D2))

Selecting two values in VLOOKUP (value, table, col_index, [range_lookup])

I'm trying to get a value from a table in another sheet based on two values in the current sheet.
This is what I have in the first sheet
And this is what I have in the second sheet
At the moment I get the expected indicador from sheet 2 for A1 cell (can be P01, P02, P03,...). But I want it to search based the cells A1 and B3, because B3 can assume equal values to different A1 values (P01, P02, P03,...).
Is it possible to select more than one value on =VLOOKUP (value, table, col_index, [range_lookup]) ?
You can look into using a combination of INDEX and MATCH:
Formula in F3:
=INDEX(A2:A3,MATCH(1,INDEX((B2:B3=F1)*(C2:C3=F2),),0))
If you were looking to return the value 11 with the other two parameters, you can adapt this to a formula in F2:
=INDEX(A2:A3,MATCH(1,INDEX((A2:A3=F3)*(B2:B3=F1),),0))
You can obviously adapt this to your needs...

Excel formula to add values based on certain criteria

Can you please help me out in obtaining this Excel formula, had tried but unable to get the expected.
If the range of A1 to A6 has starting char with S, then the corresponding B values should be added and the result should be shown in a cell.
I tried below formula, but not getting as expected:
=VLOOKUP("S*",A1:A10,2,FALSE)
VLOOKUP will only return the first item. If you want to find the Sum of cells that match a criteria, use SUMIF or SUMIFS:
=SUMIF(A4:A9,"SR*",B4:B9)
'Find the sum of Column B where Column A starts with "SR"'

Excel using a range of cells to return value corresponding to an adjacent cell in the correct cell

I have been trying this for days, and can't get it correct.
I want to see if any value in column A matches any value in column C, and if so, return the value from column B into column D, BESIDE the match in column C.
I have tried all the suggestions for If, IFERROR, MATCH, VLOOKUP, etc, but can't get it to work. Any help would be most welcome!!
Here is a picture of my spreadsheet
Use a helper column:
In column D, use COUNTIF on each row to check the number of times that a cell in column A appears. =COUNTIF(C:C,A1).
In column E, use the formula =IF(D1>0, B1,"") and copy down
(you could of course combine these if you don't want to use the extra column)
Assuming you're starting in Row 1, in column D use:
=IF(COUNTIF($A:$A,$C1)>0,B1,"NO MATCH")
Drag that down as far as you need. This formula is saying: if the value in C1 matches anything in column A, then return the value from B1.
If this isn't what you mean, then please be clearer. Your data example is unreadable. Post a screenshot, or at least type it so it is in columns and rows. It's also unclear what you mean by "BESIDE the match in column C" What value is matching which value? That is, if A1 matches any value in C, do you want the value of B1 to show up in D1? Or do you want the value of B5 to show up in D5, if A1 matched C5?
In coumn D use formula
=IFERROR(VLOOKUP(C:C,A:B,2,0),"")
Note: this formula uses Implicit Intersection see here for some info

Resources