Use Excel Concatenate function - excel

I am trying to merge the data from three columns into one column in Excel. Example, i would like to merge Product, Location, and Key_id into one column
Product Location Key_Id
Car VA 86421910
Car VA 86424482
Car VA 86416836
Combined Column:
Car 'VA', '86421910'
Car 'VA', '86424482'
Car 'VA', '86416836'
I was wondering if there is a way in Excel that can do it? Thanks in advance! I was not doing a good job of accepting the answers in the past. I will do my part which is to accept the answer moving foward.
Regards,

http://www.info-stat.com/XLConCat.htm shows examples of string concatenation in Excel. If I knew which version you were using and could identify the column IDs I could write it.
Assuming Product is Column A, Location is Column B and Key_ID is column three and data starts at row 2:
=A2&" '"&B2&"', '"&C2&"'"

=CONCATENATE(A2," '",B2,"', '",C2,"'")

Related

Find the highest value and return adjacent cell until value changes in another cell

I am an excel novice, so I hope I am explaining my problem well enough:
exceltable
Field A is the District the candidate is running in, Field B is the candidate name, Field C is the percent of the vote the candidate received, and I need Field D to calculate the District winner's name.
I am trying to calculate the name of the District winner into Field D until the District changes. I know there is probably a much better way to do what I am trying to do, but here is the formula I have pieced together so far: =IF(A2="",A1,A2 (INDEX(B2:B3,0,MATCH(MAX(C2:C3),C2:C3,0))))
Any help is appreciated!
You may try-
=CHOOSE({1,2},UNIQUE(A2:A19),BYROW(UNIQUE(A2:A19),LAMBDA(x,INDEX(SORT(FILTER(B2:C19,A2:A19=x),2,-1),1,1))))
With header-
=LET(a,UNIQUE(A2:A19),b,BYROW(a,LAMBDA(x,INDEX(SORT(FILTER(B2:C19,A2:A19=x),2,-1),1,1))),VSTACK({"Dist","Candidate"},HSTACK(a,b)))
You can try this in cell E2:
=LET(rng, A2:C19, dists, INDEX(rng,,1), names, INDEX(rng,,2),
pcts, INDEX(rng,,3),
distsUx, UNIQUE(dists),
result, MAP(distsUx, LAMBDA(dist,
TEXTJOIN(",",,FILTER(names, (dists=dist)
* (pcts = MAX(FILTER(pcts, dists=dist)))))
)),
HSTACK(distsUx, result)
)
Here is the output:
Note: In case there is more than one name within the same district with the same max pct, it returns the names delimited by comma.

Create a text cell value based on row entries and corresponding columns

I understand this is a tough way of wording the problem I have. Please try and help me.
I want to create a Column called Orders which contains cells based on corresponding item values.
So if I have columns: FlatNo, Truffle, Pineapple, Mango, Chocochips; I want to create a column called Orders which has value:
FlatNo - A51
Mango - 1
Chocochips - 1
(if no values in the Pineapple & Truffle Columns, none show up in Orders columns)
See image
How do I do that ? Thank you in advance
You can use IF and &. & simply puts the different desired things altogether.
Hope the following formula will get you the result for column orders. I have put the number of each item ordered inside parentheses before the item.
="Flat No. "&A2&IF(ISBLANK(B2),"","-("&B2&")"&$B$1)&IF(ISBLANK(C2),"","-("&C2&")"&$C$1)&IF(ISBLANK(D2),"","-("&D2&")"&$D$1)&IF(ISBLANK(E2),"","-("&E2&")"&$E$1)
For instance the third order is shown like this: Flat No. E-23-(1)Truffle -1 Pc Rs 60-(3)Mango -1 Pc Rs 60

VLOOKUP MULTIPLE RANGES

Column A and B is a item and country post code. Column B contain two country post code USA and UK. Both country we have dispatched same part. I am trying to create vlookup formula corresponding to the range but its return na. Please help me.
Country code ranges;
USA Angeles10 Angeles20 Angeles30 Angeles40 Angeles50 Angeles60 Angeles70 Angeles80 Angeles90 Angeles100 Angeles110 Angeles120 Angeles130 Angeles140 Angeles150
UK London10 London20 London30 London40 London50 London60 London70 London80 London90 London100 London110 London120 London130 London140 London150
DATA
ITEM POST CODE
4 Angeles10
4 Angeles20
110489 Angeles30
110489 Angeles40
113388 Angeles50
113388 Angeles60
113636 Angeles70
113636 Angeles80
11363613001 Angeles90
11363613001 Angeles100
11363613002 Angeles110
11363613002 Angeles120
11363613003 Angeles130
11363613003 Angeles140
1136362001 Angeles150
4 London10
4 London20
110489 London30
110489 London40
113388 London50
113388 London60
113636 London70
113636 London80
11363613001 London90
11363613001 London100
11363613002 London110
11363613002 London120
11363613003 London130
11363613003 London140
1136362001 London150
DESIRED RESULT
ITEM USA UK
4 Los Angeles10 London10
I put the first data on a sheet named datasheet in starting in A1.
Then use a formula like so in the E3:
=INDEX($B:$B,AGGREGATE(15,6,ROW($B$2:$B$31)/((ISNUMBER(MATCH($B$2:$B$31,INDEX(datasheet!$1:$1048576,MATCH(E$2,datasheet!$A:$A,0),0),0)))*($A$2:$A$31=$D3)),1))
Then copy/drag over and down.
Easiset Answer
If your data isn't changing and you know exactly where Angeles stops and London starts, you can just use a standard VLOOKUP formula. You just give the bottom part of the table to the UK column.
E3: =VLOOKUP(D3,A$3:B$6,2,)
F3: =VLOOKUP(D3,A$7:B$10,2,)
A little more complicated
If you need to be able to add rows or locations, this solution will work better. Add helper columns for each of the locations you need and a helper column which combines the item ID with the location. You can then use VLOOKUP by searching for the combination of item ID and location.
B3: =A3&CONCAT(D3:E3) (can expand past E3 for extra locations)
D3: =IF(ISERR(SEARCH(D$2,$C3)),"",D$2)
E3: =IF(ISERR(SEARCH(E$2,$C3)),"",E$2) (can drag right for each extra location)
H3: =VLOOKUP($G3&H$2,$B$3:$C$10,2,)
I3: =VLOOKUP($G3&I$2,$B$3:$C$10,2,) (can drag right for each extra location)
My favorite Answer
Just use Scott Craner's approach! ☺

Conditionally formatting if Top 10 in two categories?

I have two columns of data. I want to find which cities are in the top 10 in both columns (format IF in top10_1 AND top10_2), and this is the formula I am trying to use:
=AND(LARGE($B$2:$B$330,10),(LARGE($C$2:$C$330,10))
Any suggestions on what I can do to make it work? I included some sample data if it helps.
CityState Climate Housing
Stamford, CT 2.959 -4.234
Norwalk, CT 2.959 -4.118
San Diego, CA 2.955 -4.160
Honolulu, HI 2.949 -4.146
San Jose, CA 2.946 -4.205
LARGE returns the nth highest value in a set, so your condition would be something like:
=AND($B2 >= LARGE($B$2:$B$330,10),$C2 >= LARGE($C$2:$C$330,10))
Note the relative row reference in each condition so that the conditional formatting applies to each row individually.

Excel Nesting if clause to find names and assign a value

To nest or not to nest?
I am given a list of Emp. ID and Names in two columns
Emp. ID Name
DOEJ Doe, John
Depending on the name I want to assign a shift number to the employee in another column.
Here is the if statement I set up to search for the name and assign a shift. But I think there must be a better more efficient way.
=IF(Table4[#Name]="B,Cis",1,
IF(Table4[#Name]="Petty, Richard",1,
IF(Table4[#Name]="Trump, Donald",1,
IF(Table4[#Name]="Johnny, John",1,
IF(Table4[#Name]="Carlos, Mencina",1,
IF(Table4[#Name]="Smith, Smith",1,
IF(Table4[#Name]="Day, Conner",2,
IF(Table4[#Name]="Macho, Man",2,
IF(Table4[#Name]="Doe, John",2,
IF(Table4[#Name]="Sandy, Johnron",2,
IF(Table4[#Name]="Conner, Donaldson",2,
IF(Table4[#Name]="Randy, Jones",2,
IF(Table4[#Name]="Cook, Joseph",3,
IF(Table4[#Name]="Cooper, Johnny",3,
IF(Table4[#Name]="Rodrigo, Cooker",3,
IF(Table4[#Name]="Potter, Copper",3,
IF(Table4[#Name]="Rodrigo, Gonzolez","A",
IF(Table4[#Name]="Ronny, Ponny","A",
IF(Table4[#Name]="Rodrigo, Coolio","A",
IF(Table4[#Name]="Roma, Coma","B",
IF(Table4[#Name]="Star, Como","B","N/A")))))))))))))))))))))
Just make a table in another sheet and keep that updated with the employee/shift mapping. Then use a vlookup formula to get the shift from the employee name.
Assuming you call the other sheet "Shifts", employee name is in column A, shift code is in column B.
=VLOOKUP(Table4[#Name],Shifts!$A:$B,2,FALSE)
You could use and(...)
=if(and(...stuff that would produce 1...),1, if(and(...stuff that would produce 2...), 2, ...
Personally, I would use vba for something like this. I don't suppose you'd be open to that.

Resources