VLOOKUP combined with MIN or MAX - excel-formula

Let's say I have a products A, B and C on Sheet1:
I want to vlookup product "A" on Sheet2 and analyse the range associated with it:
E.g. Sheet1
Can I have a formula which will vlookup A from Sheet1 on Sheet 2 and perform =MAX(B1:K1) (on the range associated with A on Sheet2). It would have to be a hybrid of vlookup and MAX of some sort I would imagine?
Thanks

This works perfectly =AGGREGATE(14,6,Sheet2!$B:$K/(Sheet2!$A$1:$A$15=A1),1)
Great thanks to Scott Craner

Related

How to sum with index match formula in MS excel

I would like to sum the data in column F (Sheet1) and show the result in column B (Sheet1)(From B4 to B9).
But the sum range should be created using vlookup or index/match.
The column E in sheet1 matched with Column B in sheet2 and take the column A values in sheet2.
Then sum the data in column F (Sheet1)
=SUMIF(E4:E13;VLOOKUP(A4;Sheet2!A17:B30;2;FALSE);F4:F13)
=SUMIF(E4:E13;INDEX(A17:A30;MATCH(A4;Sheet2!B17:B30;0);1);F4:F13)
I used the formula above but its not working.
Vlookup takes only first value And index macth showing wrong number.
Can anyone help me? Thanks
Plz try this starting in B4:
=SUMPRODUCT(F$4:F$13*COUNTIFS(A$17:A$30;A4;B$17:B$30;E$4:E$13))
(I am testing this in Excel 365 - it may need array entering in Excel 2010).
Assumes there are no duplicates in the Sheet2 data - if there were, you would need:
=SUMPRODUCT(F$4:F$13*(COUNTIFS(A$17:A$30;A4;B$17:B$30;E$4:E$13)>0))
In case a 2 steps solution may work for you, you can do:
Formula in cell C17 is =IFERROR(VLOOKUP(B17;$E$4:$F$13;2;FALSE);0)
Formula in cell B4 is =SUMIF($C$17:$C$30;$A$17:$A$30;A4)
Drag down both formulas

Excel vlookup returning same value for all records

I am using VLOOKUP to pick values from Sheet2
Sheet1:
Sheet 2:
My VLOOKUP formula in C2:C5 of Sheet1:
=VLOOKUP($A2&"|"&$B2,CHOOSE({1,2},Sheet2!$A$1:$A$4&"|"&Sheet2!$B$1:$B$4,Sheet2!$C$1:$C$4),2,FALSE)
My problem is that values are same for all records.
Below are the values I see when I do F9.
Why are the same values returned?
I can get lookup data from column 3 on sheet 2 using:
=VLOOKUP(A2,Sheet2!A1:C4,3)
This might also be working
=INDEX($C$1:$C$12;AGGREGATE(15;6;ROW($A$9:$A$12)/(A2&B2=$A$9:$A$12&$B$9:$B$12);1))
just adapt the ranges to your needs

Sum the column in different sheets

I'm trying to sum a specific column in that repeats in some sheets with Macro Excel and I'm quite lost...
I have 10 different sheets and in each one the column that I'm trying to sum is in a different letter. Also, each sheet has a dynamic count of rows.
Could you show me what code I need to write to sum the column in all the sheets at once?
Thank you so much!
You can use this formula to sum or do anything in other sheet:
Example you want to sum the value from A1:A5 in Sheet1 and store it in the B3 in Sheet2, you can use this formula in cell B3 in Sheet2 like this:
=SUM(Sheet1!A1:A3)
Best,
Tung Duong (Thomas)

updating a worksheet with another sheets values

This might be easy for you but i need to use one vlookup formula since i am dealing with many numbers in two Columns.
I have two sheets one of them is Sheet1 other one is Sheet2
Both of them have two columns. Columns A contains "Materialnumber" and Column B contains "Status". Sheet1 has more "Materialnumbers" inside then Sheet2
but Sheet2 includes correct "Status", so thatswhy if "Materialnumbers" are matching i would like to have the "Status" value of Sheet2 in Sheet1's Column C.
I know i should write the vlookup code in Sheet1's Column C. But what is the right formula for this?
Thanks in advance.
You're right - just a VLOOKUP needed in column C.
In C2 put this formula:
=VLOOKUP($A2,Sheet2!$A$1:$B$12,2,FALSE)
It looks at the value in Sheet1 A2.
Compares that value against the first column in the range $A$1:$B$12 (update the range as required).
Returns the value from the second column (B).
Only returns on an exact match (FALSE).
Try this in cell C2 on Sheet1:
=VLOOKUP($A2,Sheet2!A:B,2,0)

SUBTOTAL formula?

I need a formula that uses the SUBTOTAL formula in a FILTERED table (Range A2:B50).
Column A contains Name and column B the amount in sheet1.
A1 contains the criteria name and in B1, I am looking for a formula that sums the amounts if it finds the criteria name (table Range A2:B50)
Does anyone know how I can solve this with a formula?
Using the answer given in this link:
https://superuser.com/questions/709709/combining-sumif-and-subtotal-for-dynamic-subtotal
This formula should work:
=SUMPRODUCT(SUBTOTAL(109,OFFSET($B$2,ROW($B$2:$B$50)-ROW($B$2),,1)),--($A$2:$A$50=$A$1))

Resources