I have 2 columns I am trying to populate in my sheet using vlookup. One column is the buy amount and one is the sell amount. I am using 1 unique ID to lookup into my lookup file.
However the data I am looking up has duplicate IDs, with a measure name in one column and the value in another column. The values are showing twice due to buy and sell amount names.
Looks something like this:
ID Measure Name Measure value
1 Buy 1000
1 Sell 2000
2 Buy 5000
2 Sell 10000
How can I vlookup both and populate both to my sheet like this:
ID Buy Amount Sell Amount
1 1000 2000
2 5000 10000
I got this:
=IF(VLOOKUP(A2,valumeasure3!C:U, COLUMNS(C:U),FALSE),valumeasure3!E:E,0)
Not sure where to go from here, or if vlookup is even feasible.
As #ScottCraner mentioned, SUMIFS is the way to go here.
Applied to your specific situation, your formula should be this for the Buy value:
=SUMIFS(valumeasure3!$E:$E,valumeasure3!$C:$C,$A2,valumeasure3!$D:$D,"Buy")
And the for the Sell value:
=SUMIFS(valumeasure3!$E:$E,valumeasure3!$C:$C,$A2,valumeasure3!$D:$D,"Sell")
Related
I have a list of employee names on one tab and another tab with orders shipped by employees and the month they were shipped going back 12 months. I'd like to calculate the average number of products shipped per employee per month, but I need to know how many months they were here to do that. So what I'd like to do is essentially write a formula that says give me the count of the distinct number of months they've been shipping products.
Sample employee data:
And here's the sample data on the individual shipments:
So in short, I need to know that Joe Smith shipped those 250 products across 3 distinct months to see he averages 83.3 shipments per month. Again, because there are many new people who have come onboard in the last 12 months, I can't just divide them all by 12 and need to know how many months they were shipping items in.
FILTER Shipper and Month based on Shipper column with criteria Employee name. Apply UNIQUE on filtered array to get only unique values (name + month number). Use COUNT to get active months. Divide Products Shipped by it.
Result:
Average by Count of Uniques
=LET(Shippers,B2:B11,Months,C2:C11,uShippers,E2:E4,uProducts,F2:F4,
uMonths,BYROW(uShippers,LAMBDA(uShipper,
ROWS(UNIQUE(FILTER(Months,Shippers=uShipper))))),
IFERROR(uProducts/uMonths,""))
You can use this array version, which spills all the results at once:
=LET(empl, A2:A4, prods, B2:B4, shipper, B7:B16, months, C7:C16,
ux, MAP(empl, LAMBDA(e, COUNT(UNIQUE(FILTER(months, shipper=e))))), prods/ux)
Here is the output:
It is also possible not using MAP but it is a verbose solution:
=LET(empl, A2:A4, prods, B2:B4, shipper, B7:B16, months, C7:C16,
left, TRANSPOSE(N(shipper=TOROW(empl))), right, N(months=TOROW(UNIQUE(months))),
cnts, N(MMULT(left, right)>0), ux, MMULT(cnts, SEQUENCE(ROWS(cnts),,1,0)), prods/ux)
Replacing TOROW with TRANSPOSE it should work for older Excel versions.
This is how I would have done it, create a Pivot table(Insert->Pivot Table) with Months as column, Employee as row and the values as count of shipments. Once you have the Pivot table, your life becomes easier. Now you do a count of the employee row (COUNT(COL-1:COL-X)) to count the total months a particular employee showed up.You now have count of shipments and a count of months. You can calculate the average. Not sure I can think of anything else easier.
I'm wondering if there is an easy way to do what I'm looking for. Basically, I have a balance sheet in Excel 2011 with a bunch of data. One specific piece of information I always want visible is the amount that hasn't been reimbursed. In other words, I have a column for the amount paid and another for whether or not it has been reimbursed (Yes/No). I want to sum all of the amounts paid where the reimbursed field is equal to 'No'.
I recognize I can sum the entire column and filter out those that have been reimbursed, but I'd like it to display the full amount regardless of what filter is on (or if no filter is on).
I wasn't able to find good keywords to describe this to Google, so I'm asking here. I would like to accomplish this in Excel, not in an external program or script.
If column A contains the amounts to be reimbursed, and column B contains the "yes/no" indicating whether the reimbursement has been made, then either of the following will work, though the first option is recommended:
=SUMIF(B:B,"No",A:A)
or
=SUMIFS(A:A,B:B,"No")
Here is an example that will display the amounts paid and outstanding for a small set of sample data.
A B C D
Amount Reimbursed? Total Paid: =SUMIF(B:B,"Yes",A:A)
$100 Yes Total Outstanding: =SUMIF(B:B,"No",A:A)
$200 No
$300 No
$400 Yes
$500 No
You could do this using SUMIF. This allows you to SUM a value in a cell IF a value in another cell meets the specified criteria. Here's an example:
- A B
1 100 YES
2 100 YES
3 100 NO
Using the formula: =SUMIF(B1:B3, "YES", A1:A3), you will get the result of 200.
Here's a screenshot of a working example I just did in Excel:
You should be able to use the IF function for that. the syntax is =IF(condition, value_if_true, value_if_false). To add an extra column with only the non-reimbursed amounts, you would use something like:
=IF(B1="No", A1, 0)
and sum that. There's probably a way to include it in a single cell below the column as well, but off the top of my head I can't think of anything simple.
hope it's been a good holiday.
Had a question regarding excel, that can best be phrased through an example.
I have a table which has 4 columns and 2 rows. in the each of the 4 inputs in row 1, we have a $ amount our company has (100000, 150000, 200000, 175000), and in row 2 we have the amount of product which we've been able to purchase, note: this products doesn't have a fixed price, and is constantly changing. Row 2 has the values (10000,20000,22000, 18000 respectively for the above $ amounts).
I want to have a cell, where if I input the dollar amount, I have, it will give me the average amount of product I can buy based on the historical data. Also, I need the formula to be dynamic, i.e once I add a fifth column, it takes the average using 5 datapoints, instead of the previous 4.
Thanks for any help, was having problems uploading an excel to display this, so hope this suffices.
I tried various look up/index formulas with no luck.
You want FORECAST.LINEAR():
=FORECAST.LINEAR(C6,2:2,1:1)
I currently have the following dataset:
What i would like to calculate is the following:
How can i find a way of extracting the number of times a company has only used 1 product, 2products, 3 products etc
The values in the rows are just the counts (so the amount of times a company used that product e.g. 1 means they used product once, twice means product 2 times etc)
So in the dataset image example
Company 1 has only used 1 product, i would like to apply this to the entire dataset, where only 1 product has been used. This is the same for company 2 as only 1 product was used but 3 times, so an output would say something like "2" - which corresponds to the amount of companies that have only used 1 product
And for example where there is more than one product used such as company 3, i would like to have it read "3" the amount of companies that used 3 products
etc
Any ideas
Please see my propsed outcome below:
Thanks
Add a new column PRODUCT_COUNT with the following formula, and drag down.
=COUNTIF(B2:I2,”>0”) to count the number of products utilized by each company more than zero times.
In your example you have 7 companies. So in your summary table, you could do another COUNTIF like so:
=COUNTIF($H$2:$H$8,1)
to count how many companies used exactly 1 product.
=COUNTIF($H$2:$H$8,2) to count how many companies used exactly 2 products.
=COUNTIF($H$2:$H$8,”>=3”) to count how many companies used 3 or more products.
If the number of companies changes, you would need to adjust the size of the range. A named range in the PRODUCT_COUNT column may be a good idea.
=COUNTIF(PRODUCT_COUNT,”>=3”)
This is driving me nuts.
I have a table of sales information based on dates as followed.
Date Price
1/1/12 5
2/1/12 5
12/1/12 5
Now i've used a pivot table firstly to group by week, then count the number of values for sales and tally up the Price as followed
Week Quantity Revenue
1/1/12 - 7/1/12 2 10
8/1/12 - 15/1/12 1 5
I have a 'quota' or desired quantity per week which is 3 and i'd like another column that subtracts 3 from the quantity to give me a difference like so.
Week Quantity Revenue Difference
1/1/12 - 7/1/12 2 10 -1
8/1/12 - 15/1/12 1 5 -2
I've tried adding a formula to do this but firstly i can't access the quantity column because its not a field and i can't work out the formula to make a field to replace the quantity column. Any ideas?
The only way I can figure to do it is to change the source data and add Quota and Quantity columns to it. The quota has to be calculated so that it adds up to the desired amount per week, in this case 3.
The formula for the quota calculation is:
=($F$2/7)/COUNTIF($A$2:$A$22,A2)
You can then make a calculated field, here shown as "Sum of Field 1":
This isn't a very manageable solution. And if you have multiple products and/or different quotas it will get uglier fast! But it's the best way I can see to do it with a pivot table.