Compare unique values with multiple columns and return the most recent - excel

--------------------------------------------------
| X | A | B | C | D |
--------------------------------------------------
| 1 | Fruit | List | Date | Condition |
--------------------------------------------------
| 2 | Banana | Banana | 02/05/2010 | Good |
--------------------------------------------------
| 3 | Tomato | Banana | 02/05/2014 | Excellent |
--------------------------------------------------
| 4 | Orange | Banana | 02/05/2011 | Bad |
--------------------------------------------------
I would like to compare one-by-one the items in column A with column B, then return what's in column D for the most recent date in column C for that item.
E.g.: For "Banana" (A2) - Result = Excellent
I tried some INDEX with MATCH, but I can't get the correspondent MAX value.
Thanks

This is an array formula. Enter it in E2 by holding down ctrl-shift while hitting enter. Excel will put curly braces {...} around the formula:
=IF(COUNTIF(List,A2),INDEX(Condition,MATCH(MAX((A2=List)*Date),(A2=List)*Date,0)),"")
List, Condition, and Date are named ranges corresponding to the appropriate columns. eg: B2:b7, C2:c7, D2:d7.
This screenshot is based on your original post, as edited by me before you edited it your way:

Related

Combining rows of a table using similar cells of one of its columns in Excel

I have a table (1) in Excel, with two columns, in which at the first column (A) there are some numbers and at the second column (B) there are some letters. I want to have a method to make another table (2) from (1) to put different letters at the first column then to put in each row the numbers that were corresponded to letters in table (1).
For example, let the table (1) is:
| A | B |
|---|---|
| 1 | a |
| 1 | b |
| 2 | a |
| 2 | c |
| 3 | b |
| 4 | b |
What is a method in Excel which make the following combination table:
| a | 1 | 2 | |
| b | 1 | 3 | 4 |
| c | 2 | | |
in which letters are in first column and in each row there are the numbers that were in relationship with the row's letter in table (1)?
As per below screenshot use below formula to C1 cell.
=UNIQUE(B1:B6)
And following formula to D2 cell then drag down
=TRANSPOSE(UNIQUE(FILTER($A$1:$A$6,$B$1:$B$6=C1)))

How to populate columns using values from multiple rows of another sheet (Excel)

I'm not sure what to search for this.
Basically, say I have a sheet that looks like this:
A | apple | 1
A | aardvark | 1
A | alternate | 3
B | bear | 2
B | banana | 4
C | candy | 3
C | carnivore | 2
and I want to copy values into another sheet so that it looks like this:
A | apple | 1 | aardvark | 1 | alternate | 3
B | bear | 2 | banana | 4 | |
C | candy | 3 | carnivore | 2 | |
I know there's the lookup function, but I'm not sure how to make it select the first, second, third etc. instance of what's being referenced.
Thanks in advance for any help.
For the screenshot below, use the following formulas:
E2: =IFERROR(INDEX($A$1:$A$8,MATCH(E1,$A$1:$A$8,0)+COUNTIF($A$1:$A$8,E1)),"")
F2:
=IF(INT(COLUMNS($F$1:F$1)/2)<COUNTIF($A$2:$A$8,$E2),INDEX($B$2:$B$8,MATCH($E2,$A$2:$A$8,0)+INT(COLUMNS($F$1:F$1)/2)),"")
G2:
=IF(INT(COLUMNS($G$1:G$1)/2)<COUNTIF($A$2:$A$8,$E2),INDEX($C$2:$C$8,MATCH($E2,$A$2:$A$8,0)+INT(COLUMNS($G$1:G$1)/2)),"")
Select F2 and G2, and fill to the right as far as you need, then fill the entire table down as far as you need.

Excel: get the value of third column on the behalf of second column

i am not much familiar with excel formulas and i am trying to get the value of third column on the behalf of second column.
Example:
|---------------------------------------------------------|
| A B C D E |
|-----|----------|----------|--------------|--------------|
|Sr.No| Bar Code | Cat Id | Org BarCode | Org Category |
|---------------------------------------------------------|
| 1 | 89457898 | | 85214784 | 2 |
| 2 | 87414714 | | 63247458 | 3 |
| 3 | 85214784 | | 89457898 | 4 |
| 4 | 63247458 | | ---- | --- |
-----------------------------------------------------------
i just want to update column C by column E on the behalf of column D and B
can any one please tell me the formula, how i can do this?
Use VLOOKUP. Enter the following formula into cell C1 and then copy it down the C column:
=VLOOKUP(B1, D$1:E$4, 2, FALSE)
To cover more than 4 rows, then just update the formula accordingly. If you want to display a certain placeholder value if a value in column B be not found, then you wrap the call to VLOOKUP as follows:
=IFNA(VLOOKUP(B1, D$1:E$4, 2, FALSE), "Not found")

How to assing a given value randomly in Excel?

I have 30 peoples waiting for result out of 10. I want to assign each of 30 peoples: 7, 8 or 10 result randomly.
Peoples in excel are:
A1:A30
Random numbers in Excel
B1, C1, D1 //Which means B1=8, C1=7 and D1=10
The random number to keep on:
E1 to E30
To get a random integer in a range, use the randbetween(start,end) function. This will produce a random integer between the start and end parameters inclusively. Since your numbers are not contiguous, you can simply index them and perform a lookup using vlookup(randbetween(startindex,endindex),...) to get a random value from the table.
Check out this Example Excel File I created.
Use the following steps to get your desired result:
List the people in column A
Create a lookup table in Columns G and H
containing your desired result values.
In your result column (column E in the example below), add the formula: =vlookup(randbetween(1,3),G:H,2,false)
Column E will now contain either the numbers 7,8,or 10 for each person.
If you want to generalize this and allow any number of different values in your result lookup table, you can change the formula in column E to: =vlookup(randbetween(1,counta(G:G)-1),G:H,2,false).
Note: The -1 is only needed if your lookup table has a header row.
This will select a random value from all non-empty rows in your result lookup table.
In the example below, I added a header row to row 1, and the people start in row 2, for clarity.
+---+---------+---+---+---+--------+---+-----------+--------------+
| | A | B | C | D | E | F | G | H |
+---+---------+---+---+---+--------+---+-----------+--------------+
| 1 | Names | | | | RESULT | | Result ID | RESULT Value |
+---+---------+---+---+---+--------+---+-----------+--------------+
| 2 | Person1 | | | | 7 | | 1 | 7 |
+---+---------+---+---+---+--------+---+-----------+--------------+
| 3 | Person2 | | | | 7 | | 2 | 8 |
+---+---------+---+---+---+--------+---+-----------+--------------+
| 4 | Person3 | | | | 10 | | 3 | 10 |
+---+---------+---+---+---+--------+---+-----------+--------------+
| 5 | Person4 | | | | 8 | | | |
+---+---------+---+---+---+--------+---+-----------+--------------+

Kind of group by in Excel without VBA

I need another transformation help in Excel
| A | B |
---| ----|--------|
1 | ID | Course |
2 | 1 | A1 |
3 | 1 | A2 |
4 | 2 | A1 |
5 | 3 | A2 |
I want to have a kind of group by, i.e.
| A | B | C |D | ...
---| ----|---------|---------|---------|----
1 | ID | Course1 | Course2 | Course3 | ...
2 | 1 | A1 | A2 | | ...
3 | 2 | A1 | | | ...
4 | 3 | A2 | | | ...
Any ideas? Is it possible without VBA macro?
I believe that the following link on removing duplicates from column would suit your needs (in your case you would do it horizontally).
http://www.get-digital-help.com/2009/03/30/how-to-extract-a-unique-list-and-the-duplicates-in-excel-from-one-column/
Per your reply to Robert, if you want to do it without VBA, try this... Select all cells in the first column. Copy and paste them into the first column of another worksheet. Use Excel's Remove Duplicates function on the pasted data. Then use INDEX functions in the columns to the right in order to pull the first, second, etc values matching that first column value.

Resources