Latest Value from the column level to specific code - excel-formula

Can anyone pls help me to get the latest/running value for A & B....
NAME FSales ESales
A 100 500
A 50 170
B 100 300
B 130 200
A 70 230
B 50 450
OUTPUT SHOULD BE
Output FSales ESales
A 70 230
B 50 450

As given in the image below, enter the formula in cell B12 and drag to right and then down.
=LOOKUP(2,1/($A$2:$A$7=$A12),B$2:B$7)

Related

Sum column in Excel from 1 value in a separate column until a different value in the criteria

I am trying to sum a column A based on a value in column B, but I only want to sum the values until I reach a different criteria value (in column B). When I reach that value, I want to reset the function & repeat.
A
B
Sum Value I'm looking for
12
N/A
12
34
N/A
46
21
N/A
67
45
BREAK
109
232
N/A
232
64
N/A
296
231
BREAK
527
423
BREAK
423
46
N/A
46
4
N/A
50
56
N/A
106
86
N/A
192
235
N/A
427
463
BREAK
890
3
N/A
3
57
N/A
60
75
BREAK
135
I have tried SUMIF but cannot get this to work. Any help would be greatly appreciated.
Thank you!
The following formula should work:
=SUM(A$2:A2)-SUMIF(B$1:B1,"BREAK",C$1:C1)
And populate down
I've started using this formula (in cell C2):
=IF(B2="BREAK";A3;C2+A3)
This is not entirely correct, but it gives another idea: in order to repeat the calculation of the whole sum, you do this in an cumulative manner (first you get A2+A3 (which you put in cell C2), then A2+A3+A4 (which you put in cell C3), ...).

Match duplicates with highest numbers [excel formula]?

Can someone help me with the formula here? I have used something like this before ={MAX(IF(...} but it doesn't really fit what I'm doing now.
=MAX(IF(Sheet1!$A$a:$A$1500=Sheet3!D19,Sheet1!$G$1:$G$1500))
I need to identify that I have duplicates in column A, then look at column B and find the highest value for e.g. cat, then match this highest value with the highest in column C (as you can see "cat" has two 140 figures but in C one of them =56, thus I need "OK" next to it). I would be greatly obliged for your help.
Col A B C Formula?
cat 140 56 OK
cat 140 54 x
cat 87 41 x
cat 91 13 x
cat 100 11 x
dog 230 12 x
dog 230 55 OK
dog 230 45 x
mouse 111 12 x
mouse 123 43 x
mouse 145 55 OK
mouse 103 54 x
Try this in C2 and fill down.
=IF(AND(B2=AGGREGATE(14, 7, B:B/(A$1:A$13=A2), 1), C2=AGGREGATE(14, 7, C:C/((A$1:A$13=A2)*(B$1:B$13=AGGREGATE(14, 7, B:B/(A$1:A$13=A2), 1))), 1)), "OK", "x")

remove mismatched rows in excel

I am having an excel file with 2000 records containing few columns like
A B C D E
114 5 270 product1 118
117 3 150 product1 190
118 9 300 product2 114
190 6 110 product1
191 11 540 product3
what I want to do is I want to remove the rows that are not matching the column A with E.
Expected Output
A B C D E
114 5 270 product1 114
118 9 300 product2 118
190 6 110 product1 190
Please help me
Assumption: your data table is in Sheet1, your Expected Output Table is in Sheet2.
Steps:
Copy column E of data table (DT) to column A of Expected Output Table (EOT).
Sort col A of EOT ascendingly (e.g. Data Ribbon > Sort & Filter).
Formula in B1 (EOT):
=Index(Sheet1!B$1:B$5, Match(Sheet2!$A1, Sheet1!$A$1:$A$5, 0), 1)
Above formula goes into the columns B to D in EOT.
Formula in E1 (EOT):
=$A1
The Index/Match would work even better if you had column headers. Then it would not matter whether the info from col B (DT) also goes into col B in EOT. Anyways, remember to adjust the ranges to your actual ones, and be careful with the $ signs.

Compare column A with column B and return minimum value in column A in Column C

Here is my table. I want to return the minimum value from column A in column C only if the values in Column B are equal.
A B C
1 Price Category Lowest Price Per Category
2 240 19
3 231 19 231
4 233 19
5 450 12
6 438 12
7 425 12 425
8 674 33
9 675 33
10 671 33 671
You could try the SUBTOTALfunction and use this formula in the column for lowest:
=IF(A2=SUBTOTAL(5;$A$2:$A$4);A2;"")
You would have to manually adjust the locked range ($A$2:$A$4) for every group though so that it matches the range for the group.
Or if your happy with getting the min value for each group on a separate row under every group you could just mark the two columns (including header row) and use the Subtotalbutton on the Data tab set like in this image:
Then the result would look something like this:
Price Category
240 19
231 19
233 19
231 19 Min
450 12
438 12
425 12
425 12 Min
674 33
675 33
671 33
671 33 Min
231 Grand Min
Try using this formula in C2 copied down
=IF(COUNTIFS(B:B,B2,A:A,"<"&A2),"",A2)
COUNTIFS here counts rows where the category matches and the price is lower than the current row. If there is no such row then the current row price must be lowest for that category and the price is returned.
If there are tied lowest prices within any category then they will all be shown

How to get the corresponding values of the latest date in Excel?

I have this values in my excel:
A B C D
StaffId FSales ESales Date
1 100 500 23-Jan-13
1 50 170 25-Jan-13
1 70 230 26-Jan-13
2 100 300 25-Jan-13
2 130 200 27-Jan-13
Outcome wanted:
A B C D
StaffId FSales ESales Date
1 100 500 23-Jan-13 10:00:00AM
1 50 170 25-Jan-13 11:00:00AM
1 70 230 26-Jan-13 11:30:00AM
2 100 300 25-Jan-13 03:00:00PM
2 130 200 27-Jan-13 02:00:00PM
3 100 200 29-Jan-13 01:01:00PM
3 90 209 29-Jan-13 01:00:00PM
A B C D
StaffId FSales ESales Date
1 70 230 26-Jan-13 11:30:00AM
2 130 200 27-Jan-13 02:00:00PM
3 100 200 29-Jan-13 01:01:00PM
Lets say dates are jumbled up and not arranged in any order. How can i get the latest date Fsales and ESales for each staff?
Meaning getting 70 230 for staffid 1 and 130 200 for staffid 2.
Help needed please
Assuming you have the second list with the unique staff ID in Sheet2 and the original list in Sheet1, starting in row 2, enter the following formula:
FSales max in Sheet2!B2: =INDEX(Sheet1!$B:$B,MATCH(MAX(Sheet1!$D:$D*(Sheet1!$A:$A=A2)),(Sheet1!$D:$D*(Sheet1!$A:$A=A2)),0))
ESales max in Sheet2!C2: =INDEX(Sheet1!$C:$C,MATCH(MAX(Sheet1!$D:$D*(Sheet1!$A:$A=A2)),(Sheet1!$D:$D*(Sheet1!$A:$A=A2)),0))
Both formulas are array-formulas, i.e. enter them with Ctrl-Shift-Enter instead of Enter.

Resources