I am looking for a formula to reference a value from a table based on two column values and one row value. I tried for hours with different sumifs, match, etc. formulas but nothing worked. An example would look as follows:
Manager Marketplace Jan Feb Mar
mgr1 US 312 546 987
mgr1 DE 546 329 715
mgr2 FR 267 195 546
The formula should find the correct value if given for example mgr1, US and Feb.
Any Ideas?
Best,
Moritz
Another option:
=INDEX(C2:E4,MATCH(1,INDEX((A2:A4="mgr1")*(B2:B4="US"),0,1),0),MATCH("Feb",C1:E1,0))
=INDEX(A:E,MATCH("mgr1"&"US",A:A&B:B,0),MATCH("Feb",1:1,0))
This is an example of a two way lookup, concatenating the vertical lookup section of the index formula.
Try,
=INDEX(C:E, AGGREGATE(15, 7, ROW($2:$9)/((A$2:A$9=H2)*(B$2:B$9=I2)), 1), MATCH(J2, C$1:E$1, 0))
Related
My First Sheet
Customer_Email
a1b1y1#gmail.com
usharao_h#rediffmail.com
bhimdipti#gmail.com
ramyan249#gmail.com
kannans1690#gmail.com
puharaman#gmail.com
rajiishiva90cs#yahoo.com
vibeeshanans#hotmail.com
basker.p#gmail.com
puharaman#gmail.com
gopalvenki#yahoo.com
gopalvenki#yahoo.com
On 2nd Sheet
ID Customer_Email
1058 18pe08#gmail.com
771 1991harishjayaraj#gmail.com
601 1995asrsanjay#gmail.com
619 2000.harikesh#gmail.com
459 678prabakaran#gmail.com
418 7411110424mm#gmail.com
590 98josh#gmail.com
557 a_rajendiran12#yahoo.co.in
226 a.p.praveen.30#gmail.com
702 a1b1y1#gmail.com
21 aartikolambkar#gmail.com
362 aaryahsingh77#gmail.com
1005 aaryan8587#gmail.com
167 aasshoka#gmail.com
966 abashwanth13#gmail.com
560 abbas15_99#yahoo.com
I need the corresponding ID from sheet2 to sheet1
The below one I used in sheet1's B2 Cell
=VLOOKUP(A2,Sheet2!A$2:B$1000,1,0)
Returns N/A and the error shows Did not find value 'a1b1y1#gmail.com' in VLOOKUP evaluation.
According to the VLOOKUP syntax - the search for values takes place in the first column of the range. In your formula VLOOKUP tries to find the value 'a1b1y1#gmail.com' in the column Sheet2!A$2:A1000 and clearly can not find it there, because this text is in the range Sheet2!B$2:B1000
In Google Sheets you can use the following formula =ARRAYFORMULA(VLOOKUP(A2,{Sheet2!B:B,Sheet2!A:A},2,0)) - here we swap the ranges for finding the key and the range for output directly in the formula
The lookup field must be the first column in your data table. Otherwise Vlookup will not work. That means your ID field must be after the Address.
In Excel 2013, I need to sum all numbers in a column of actual costs plus estimates in a second column in rows where the actual costs are blank.
Estimate (A) Actual (B)
Row 1 106
Row 2 212 230
Row 3 318 295
Row 4 424
totals 1060 525
I need to return 106 + 230 + 295 + 424. (or 525 + 106 + 424)
What I have tried:
--I have solved the problem if I put a placeholder (like "missing") in the blanks and then using a SUMIF nested in a simple SUM. But that badly clutters the chart.
=SUM(A5, SUMIF(B1:B4,"missing",A1:A4))
--I have also solved the problem by creating a calculation column that has an ISBLANK function and then using the SUMIF over that result. However, I can't figure out how to consolidate. I realize I could create another sheet to hold the calculation column, but the workbook will already have a number of sheets and I want to avoid an extra.
C1=ISBLANK(B1) dragged down to C4 and then =SUM(A5, SUMIF(C1:C4, "TRUE", A1:A4))
--I have found a number of online descriptions of managing similar tasks with pivot tables and months, but I can't seem to figure it out for a simple table.
I think my ISBLANK attempt is failing on consolidation because of something to do with absolute references vs. ranges in the column, but I can't figure it out.
Any advice would be greatly appreciated--thanks
Use SUMIF() to sum all numbers in column A if the value to the right is blank. Then add the sum of column B.
See this formula:
=SUMIF(B:B, "", A:A) + SUM(B:B)
Use array version of SUM(IF()):
=SUM(IF(B1:B4<>"",B1:B4,A1:A4))
Being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.
I need help with vertical search in Excel 2010.
I have a document with two sheets, in each sheet is one table containing data ...
sheet one
A B C D
123 sth sth 'need to find and copy value from second sheet(key is collumn A); formula here
321
678
845
983
sheet two
A B C
123, 321 sth 100 'looking for this value, copy 100 to first sheet to key 123 and also 321
678 99 'value for key 678 in sheet one
845, 983 82 'value for keys 845 and 983 in sheet one ..
I use vlookup(), but when I have two values separated with comma in one cell it doesn't work and I have to do it manually.
Is there a function something like vlookup which I can combine with left() and right() functions, or do I have to use something more sophisticated, a VB macro?
I cannot change layouts of these sheets ...
Thank you.
Use an array formula with SEARCH?
{=IF(SEARCH(A1,Sheet1!A:A),Sheet2!D:D)}
slightly more comprehensive version of that:
{=SUM(IF( NOT(ISERROR(SEARCH(A1,Sheet2!A:A))),Sheet2!D:D))}
as mentioned by Nanashi, you can change sum to average or whatever you like handle multiple values
You need to use ctrl+shift+enter to make a formula an array formula.
Rather hacky solution that uses formulas only.
Enter in Sheet1!C1:
=IF(COUNTIF(Sheet2!$A:$A,Sheet1!$A1)=1,VLOOKUP(Sheet1!$A1,Sheet2!$A:$C,3,FALSE),SUMIF(Sheet2!$A:$A,"*"&Sheet1!$A1&"*",Sheet2!$C:$C))
Sample result:
Sheet2
Sheet1
Disclaimer:
This method is very easy to break. One possible failing is that if there are no spaces between the IDs in Sheet2, the formula fails. Also, if by any chance the ID repeats in Sheet2, they will be added due to the usage of SUMIF. A workaround is to use AVERAGEIF instead.
I have a large excel speadsheet with (amongst others) the following columns
orderId price
222 50.00
222 52.60
223 44.00
223 60.00
224 20.00
225 40.00
Is there a way to display the orderId as a Unique row with the sum of all prices under that id? So this example would result in
orderId price
222 102.60
223 104.00
224 20.00
225 40.00
I'm happy to create a macro to do the job if necessary (I have VB knowledge but haven't used it for years and I've never applied it to excel before)
This is easily solved via Pivot table unless i am mistaking your requirement.
Insert -> Pviot table
set as below
Although it's not a VBA solution, you can just copy and paste the Order ID column and use "remove duplicates" from the Excel ribbon to make a unique list. Then to the right of each entry, just put =SUMIF(A:A, C1, B:B), where A:A I assume is the order ID column, C1 is the first entry in the unique list, and B:B i assume is where the values are.
=SUMIF(what is the range you want to look through?, what do you want to look for?, where are the values you want to add up?)
For VBA, you could get fancy and use the dictionary object, simply entering each unique value you find in the object id column, and if it exists, then just add the total to the value for that entry. At the end, just use the .keys and .items to output the list. :)
I have a problem that shouldn't be a problem but I'm unable to solve it.
My data looks like this:
2012-04-05 1280
2012-04-17 1340
2012-04-20 1510
2012-05-03 1670
2012-05-09 1880
What I want to do is to find the MAX value for april and for may.
So MAX for april should return 1510 and MAX for may should return 1880. Can this be done?
EDIT:
Maybe simplified it a bit too much, here is an example closer to what I really want to do:
2012-04-04 14 220
2012-04-11 453 863
2012-04-19 900 1310
2012-05-02 1400 1810
2012-05-15 1900 2250
These are milage from my cars trip computer. I would like to calculate how far I drove each month.
For april: 1310-14 = 1296
For may: 2250-1400 = 850
A simple array formula can do this. If your dates are formatted as dates in Excel, paste the following into a cell and press Ctrl+Shift+Enter:
=MAX(IF(MONTH($A$1:$A$5)=4,B1:B5))
Can this be expanded to also allow 0 to be filtered out? When you use the MIN instead of MAX and your data range has empty values this results into 0 to be reported as the lowest value.
A simple array formula can do this. If your dates are formatted as dates in Excel, paste the following into a cell and press Ctrl+Shift+Enter:
=MAX(IF(MONTH($A$1:$A$5)=4,B1:B5))
If your dates are formatted as text, paste the following into a cell and press Ctrl+Shift+Enter:
=MAX(IF(MID($A$8:$A$12,6,2)="04",$B$8:$B$12))
if you just need the answer once, filter by month and run a max function.
You could use a pivot table. Below, Amount is summarized by Max. I right-clicked on the date column, chose Group By and then selected both Year and Month. The picture obviously shows the source data, pivot table and two dialogs. In practice you'd put the pivot table on its own worksheet:
You can use this simple formula to get max of the month in a given range.
where J2 - J7 is my date range, use Max to get maximum of the dates in that range and use text to get the month.
=TEXT(MAX(J2:J7),"mmm")