Excel same multiple values match same multiple values - excel

Can I obtain G column in table 2 with formula?
More clearly, search first 155 in A column and write first match, search second 155 in a column and write secont match...

Related

Merging only one column on matching rows

I have a spreadsheet where I have duplicate records(rows). Typically I have 2 rows per record and I need one. The rows are identical apart from one column. Is there a way to merge duplicate rows based on their ID in Column A but only merge column D
Column B for example as the same number, I don't want to merge this column as it will provide the wrong figure as column D has different words per row.
Data is currently.
Column A Column B Column C Column D Column E Column F
178924 £125 £895 Card 82 92
178924 £125 £895 Stamp 82 92
178927 £11 £85 Card 52 69
178927 £11 £85 Stamp 52 69
Perfect result would be
Column A Column B Column C Column D Column E Column F
178924 £125 £895 Card, Stamp 82 92
178927 £11 £85 Card, Stamp 52 69
You could do the following formula in Column G
=$D1 & ", " & VLOOKUP($A1, $A2:$D6, 4, FALSE)
Where your data is entered into A1.
This will return #N/A for unmatched records (you can use IFERROR to mask this with something else if you require) and a concatenation of Column D as in your expected output for matched records. You can filter the results to remove the unmatched to display your desired result.
This solution only works for the first instance of your ID (assuming only 2 instances of each ID in your question). If you want to delete unmatched rows you would have to use VBA.

How to populate a particular cell value between two columns in Excel?

I am facing problem to populate a cell value.
For example i have two columns A and B as shown below
A B
381 369
382 370.3
384 370.3
385 371
386 372
My aim is to get the respective value of column B value 370.3 as 382.
I tried using Vlookup formula "=VLOOKUP(D3,A:B,2,TRUE)"
Please help me to find the correct code to get the solution as in the image
If you wish to find "370.3" ie the contents of cell D3 then you will need to match in column B and index in column A so:
=INDEX(A1:A6,MATCH(D3,B1:B6,0))
VLOOKUP will not work as it indexes the leftmost column... or you change the data order.

How do I split a row of text into different columns according to number of characters using a macro in Microsoft Excel?

I want to know if I can use a macro in Excel to separate data in a single column into different colums according to number of characters. For example, what I have is this in column A
A
AB
ABC
1A
564
8
What I need is this, in colums A, B and C
A AB ABC
8 1A 564
Thanks.
Use the following formula in a new column B next to Column A:
=IFERROR(INDEX($A$1:$A$6,SMALL(IF(LEN($A$1:$A$6)=1,ROW($A$1:$A$6),99999),ROW()),1),"")
Array Formula press Ctrl+Shift+Enter at the same time
and drag it down, it will write the Values of B whose Length is 1, and when it gives empty it means no more Values with Length 1
Small will find the Cell which length is 1 (Row()=1, 1st cell which length=1, Row()=2, 2nd cell which length =1 ...)
If will return all the rows for the corresponding condition
Index will return the Cell
Iferror return empty "" if no more match
For the second column write 2 instead of 1 in LEN($A$1:$A$6)=2
=IFERROR(INDEX($A$1:$A$6,SMALL(IF(LEN($A$1:$A$6)=2,ROW($A$1:$A$6),99999),ROW()),1),"")
For the third column write 3 in LEN($A$1:$A$6)=3
=IFERROR(INDEX($A$1:$A$6,SMALL(IF(LEN($A$1:$A$6)=3,ROW($A$1:$A$6),99999),ROW()),1),"")

Excel Function to sum values from table based on a comma separated list

I am trying to find a function that will look at a table and sum all the values where the string appears in my comma separated list. I can get sumproduct to work if my list is separated into different cells, but I need the list to be in one cell. Here is what I'm looking for:
List in Cell A1: 2000,2100,2300
Table: A10:B16
A B
2000 20
2100 25
2200 32
2300 65
2400 72
2500 12
2600 2
I'm looking for a result of: 110
Any help would be appreciated.
Thanks!
I am assuming that you can use another column but not for your list?
If so you can use the formula below in column C
=IF(ISERROR(FIND(A2,$A$1,1))=FALSE,TRUE,FALSE) with A2 being the 1st cell in which the data is contained.
This is searching through your comma separated list and evaluating against the data in column B whether it exists in the list, if so then returns true if not false.
Now you can use the SUMIF function to return those matching true in your new column C.
=SUMIF(C2:C8,TRUE,B2:B8)
If having the evaluation column C is a problem for other users you could always hide it

How to get unique values in a column using excel formula

I have Excel Data like below
JID Val
1001 22
1030 6
1031 14
1041 8
1001 3
2344 8
1030 8
2344 6
1041 8
How do i get the unique JID values like below using formula?
UJID
1001
1030
1031
1041
2344
Here is a solution to get a list of unique items from your tables
There is two parts to this solution.
Part 1) Unique Count
{=SUM(IF(FREQUENCY(IF($A$2:$A$10<>"",MATCH($A$2:$A$10,$A$2:$A$10,0)),ROW($A$2:$A$10)-ROW($A$2)+1),1))}
This will count the number of unique items in your data table and will ignore any blanks
*Note this is an array formula and you will need to use "Ctrl" + "Shift" + "Enter" to use
Part 2) Unique List
This formula will give you the list of unique items in your table
={IF(ROWS($E$5:E5)>$E$2,"",INDEX($A$2:$A$10,SMALL(IF(FREQUENCY(IF($A$2:$A$10<>"",MATCH($A$2:$A$10,$A$2:$A$10,0)),ROW($A$2:$A$10)-ROW($A$2)+1),ROW($A$2:$A$10)-ROW($A$2)+1),ROWS($E$5:E5))))}
again this is an array formula. You can then drag this formula down to get all the unique items.
This formula is a dynamic formula, meaning you can set the data range past your current data range and the list will update as you enter new values.
*Here is a great video to watch to understand this further
https://www.youtube.com/watch?v=3u8VHTvSNE4
You can use the remove duplicate function
Select the column range
Go to Data Tab
then click on Remove Duplicates
I think I've found a more elegant workaround without array-functions or built-in functions:
1st column (ID):
this is the array from we'd like to select distinct values
2nd column (criteria):
checks whether this is the first occurrence
=IF((ROW()-1)=MATCH(A2,$A$2:$A$500,0),1,0)
3rd column (cumulative):
=SUM($B$2:B2)
4th column (count):
this is constant 1
5th column (unique ID):
=OFFSET($A$2,MATCH(ROW()-1,$C$2:$C$501,0)-1,)
6th column (count):
=SUMIF(A2:A21,F2,D2:D21)

Resources