I would like to calculate the minimum of some values. Beside this I want to catch the value of the "Minimum" header.
Example:
+------------+----------+--------+------+--------+
| A | B | C | D | result |
+------------+----------+--------+------+--------+
| item | New York | Boston | Phil | --- |
| Apple | 3.4 | 4.2 | 2.3 | Phil |
| Peach | 2.2 | 2.5 | 1.7 | Phil |
| Strawberry | 5.5 | 5.1 | 7.3 | Boston |
+------------+----------+--------+------+--------+
I can find the MIN() in the row 'Apple'. But how can i manage to receive the column header as a result like Phil in this example?
You can use INDEX + AGGREGATE:
=INDEX($B$1:$D$1;AGGREGATE(14;6;(B2:D2=MIN(B2:D2))*COLUMN(B2:D2)-1;1))
Related
So I have this information:
+---------------+---------+-------+------------+
| Chocolate | Brand | Stock | Sale value |
+---------------+---------+-------+------------+
| Chokito | Nestlé | 1520 | $3,50 |
| Snickers | Mars | 3300 | $5,20 |
| Snickers 2 | Mars | 500 | $2,50 |
| Kit Kat | Nestlé | 2000 | $9,10 |
| Double Decker | Cadbury | 1000 | $2,50 |
| Idaho | Mars | 0 | $6,10 |
| Caramello | Cadbury | 350 | $7,50 |
| Cadbury Daily | Cadbury | 1000 | $3,10 |
| Almond Joy | Hershey | 500 | $1,50 |
| Twix | Nestlé | 999 | $4,50 |
| Zero Bar | Hershey | 488 | $5,50 |
+---------------+---------+-------+------------+
Wha I want to get the total stock value for each brand. I get these values by inserting a column of of stock * value then doing a Pivot Table
Cadbury $8.225,00
Hershey $3.434,00
Mars $18.410,00
Nestlé $28.015,50
But what I want to do is a formula in Excel that will get this same values.
I first tried using SUMIF but obvioulsy it didnt worked xD
I cant think of any other formula
Thanks for your help
Try,
=SUMPRODUCT((C$2:C$12), (D$2:D$12), --(B$2:B$12=G4))
For a dynamic length of data,
=SUMPRODUCT((C$2:INDEX(C:C, MATCH(1E+99, C:C))), (D$2:INDEX(D:D, MATCH(1E+99, C:C))), --(B$2:INDEX(B:B, MATCH(1E+99, C:C))=G4))
Alternative approach using sumif
Place the following in E2 and copy down
=D2*E2
this will give the value you of each individual chocolate level in stock
in column G generate a list of brands
in H2 use the following formula and copy down as needed
=SUMIF(B:B,G2,E:E)
I am trying to create a list of names that repeat a specific number of times, based on another variable. Basically, if I have the following:
Column A Column B
Amy 5
John 2
Carl 3
the result would be:
Amy
Amy
Amy
Amy
Amy
Carl
Carl
Carl
John
John
I have built the initial list using the Index-Small-Countif, method, to get an alphabetical and distinct list, and then another formula to determine how many times each item repeats. I know I need to use some sort of index/offset with reference to rows, but just can't quite get it to work out.
The list is dynamic and changes daily, so manually retyping the list each day would result in too much human error and time (list is about 50 distinct items, with total number of rows at the end being around 400). Ultimately, the list will be used for a number of sumproduct/vlookups.
I can do this fairly quickly in VBA, but the users of this document don't always trust VBA and trying to get them to Enable Macros each time is not something that is going to work.
Thank you very much for any help you can offer!
Based on your table:
+---+------+---+
| | A | B |
+---+------+---+
| 1 | Amy | 5 |
| 2 | John | 2 |
| 3 | Carl | 3 |
+---+------+---+
In column C stick a "0" at C4 and formula =B1+C2 copying down to just before the 0:
+---+------+---+----+
| | A | B | C |
+---+------+---+----+
| 1 | Amy | 5 | 10 |
| 2 | John | 2 | 5 |
| 3 | Carl | 3 | 3 |
| 4 | | | 0 |
+---+------+---+----+
Now we have an upper bound of the row that each value should be placed on which we can use in a Match() formula which will feed an Index() formula.
In a new column (I'm using E) IN E1: =INDEX($A$1:$A$3,MATCH(ROW(),$C$1:$C$3,-1),1) and copy down
+----+------+---+----+--+------+
| | A | B | C | D | E |
+----+------+---+----+--+------+
| 1 | Amy | 5 | 10 | | Carl |
| 2 | John | 2 | 5 | | Carl |
| 3 | Carl | 3 | 3 | | Carl |
| 4 | | | 0 | | John |
| 5 | | | | | John |
| 6 | | | | | Amy |
| 7 | | | | | Amy |
| 8 | | | | | Amy |
| 9 | | | | | Amy |
| 10 | | | | | Amy |
+----+------+---+----+--+------+
The list is backwards because of that oddball backwards from 0 thing we did in Column C. This is to make that Match() last parameter of -1 (Greater than) work correctly.
I would imagine with some tweaking this could be done a little cleaner, but this should get you in the ballpark.
Although I would still be a big proponent of finding users who are capable of enabling macros. Ugh.
I have this table:
| | A | B | C |
|---|---------|--------|---|
| 1 | | | |
| 2 | Oranges | Red | 1 |
| 3 | Apples | Yellow | 2 |
| 4 | Grapes | Orange | 3 |
| 5 | Oranges | Orange | 4 |
| 6 | Apples | Red | 5 |
| 7 | Grapes | Green | 6 |
| 8 | Apples | Green | 7 |
I want to check for matching values in Column A like Apples,Yellow , Apples,Green, etc... and return all the corresponding values from Column B in one row:
I tried to nest AND into IF but didn't work out as it wasn't returning any values at all.
| | A | B | C | D | E |
|----|---------|-------------|---|---|---|
| 11 | Apples | Green | 1 | | |
| 12 | Oranges | YellowGreen | 2 | | |
My code:
=INDEX($B$2:$B$8, SMALL(IF($A$11=$A$2:$A$8, ROW($A$2:$A$8)-ROW($A$2)+1), COLUMN(A1)))
How do I get this formula to look at two variables to match?
Thank you.
You seem to be using an array formula, wouldn't concatenating work?
{=INDEX($C$2:$C$8, SMALL(IF($A11&" "&$B11=$A$2:$A$8&" "&$B$2:$B$8, ROW($A$2:$A$8)-ROW($A$2)+1), COLUMN(A1)))}
I have a excel data
_________________________________________________________________
| A B C | D |
|--------------------------------------------------------------|-------|
| 1 | Device | Country | | |
|----------------------------------------------------------------------|
| 2 | Android tablet | iNDIA | | |
|----------------------------------------------------------------------|
| 3 | Android | India | | |
|----------------------------------------------------------------------|
| 4 | Android | Bangladesh | | |
|----------------------------------------------------------------------|
| 5 | Android | Pakistan | | |
|----------------------------------------------------------------------|
When i am using this formula
=COUNTIF(A2:A5,"Android") its returning me 3.
Thats means its taking only "Android"
But i want "Android tablet" should also be taken in account that means the result becomes 4. There may be some wild card method but i dont know that
How can i achieve this?
* is the wildcard in Excel:
=COUNTIF(A2:A5,"*Android*")
I have a data in Excel:
+-----------------------------+--------------------+----------+
| Name | Category | Number |
+-----------------------------+--------------------+----------+
| Alex | Portret | 3 |
| Alex | Other | 2 |
| Serge | Animals | 1 |
| Serge | Portret | 4 |
+-----------------------------+--------------------+----------+
And I want to transform it to:
+-----------+-----------+-------+---------+
| Name | Portret | Other | Animals |
+-----------+-----------+-------+---------+
| Alex | 3 | 2 | 0 |
| Serge | 4 | 0 | 1 |
+-----------+-----------+-------+---------+
How can I do it in MS Excel ?
You can use a pivot table for that
Take a look at http://office.microsoft.com/en-gb/excel-help/pivottable-reports-101-HA001034632.aspx