I have a simple Excel spreadsheet with a single row and 4 columns. I'm trying to concatenate 3 cells in the row together using a range instead of specifying all 3 cells explicitly (for times where I need to concatenate several cells).
The data is as follows:
[A1] 5
[B1] 6
[C1] 7
[D1] =CONCATENATE(A1:C1)
The result I get in D1 is #VALUE instead of what I'm looking for, which would be 567.
Is there a way to accomplish this using a range?
If you have Office 365:
=CONCAT(A1:C1)
If not
=A1 & B1 & C1
or
=CONCATENATE(A1,B1,C1)
A helper column can gradually build the string, by concatenating above row with the next value.
A B B (formula)
1 h h =A1 Initial value
2 e he =B1&A2 Concatenate above cell with next value
3 l hel =B2&A3 Copy formula downwards, it should auto-increment.
4 l hell =B3&A4
5 o hello =B4&A5
(Similar question: Concatenate range in Excel with formulas)
Related
I'm trying to get a list of values that contain duplicates into unique rows.
Column A
Cell 1
Cell 2
Cell 3
Cell 1
Cell 2
Cell 3
Cell 1
Cell 2
Column A
Column B
Column C
Cell 1
Cell 1
Cell 1
Cell 2
Cell 2
Cell 2
Cell 3
Cell 3
I've tried using
=TRANSPOSE(UNIQUE(A1:A3,TRUE,TRUE))
But any combination of the formula removes the duplicates and I want to maintain them.
with MakeArray:
=LET(
rng,A1:A8,
u,UNIQUE(rng),
MAKEARRAY(
ROWS(u),
MAX(COUNTIF(A1:A8,u)),
LAMBDA(a,b,
IF(COUNTIF(A1:A8,INDEX(SORTBY(u,COUNTIF(A1:A8,u),-1),a))>=b,
INDEX(SORTBY(u,COUNTIF(A1:A8,u),-1),a),
""))))
This will expand automatically to any number. It will also put the ones with the most duplicates at the top so it is an inverted pyramid:
Alternatively, you can try:
Formula in C1:
=IFERROR(DROP(REDUCE(0,UNIQUE(TOCOL(A:A,1)),LAMBDA(x,y,VSTACK(x,EXPAND(y,1,COUNTIF(A:A,y),y)))),1),"")
Or, with a build-in sort function:
=SORT(IFERROR(DROP(REDUCE(0,UNIQUE(TOCOL(A:A,1)),LAMBDA(x,y,VSTACK(x,EXPAND(y,1,COUNTIF(A:A,y),y)))),1),""),1)
I'm trying to:
In cell C3, search Column J to find an identical match of B3, then copy the data from Lx.
In cell D3, Search Column J to find an identical match of B3, then copy the data from Mx.
There are 10285 rows of data.
I have tried several IF and VLOOKUP statements.
In the group of columns, J:L, L is the fourth column, so use 4 in VLOOKUP:
Formula for C3:
=VLOOKUP($B3,$J:L,3,FALSE)
D3 is the same, but with 4 instead of 3 to get M.
If you want to get fancy and have the formula copy nicely across columns, you can use the COLUMN() function to help calculate the 3s and 4s:
Formula for C3:
=VLOOKUP($B3,$J:L,COLUMN(L3)-COLUMN($J3)+1,FALSE)
Then when you copy that from C3 to D3, the L becomes M and the column calculation produces 4 instead of 3.
I have the following Excel spreadsheet:
A B C D E F G H I
1 Search Criteria: Prod.B
2 Column: 2
3 Prod.A Prod.B Prod.B Prod.C Prod.C Prod.D
4
5
Currently I use the following formula in Cell C2 to get the column of the search criteria in Cell C1 in the Range D3:I3.
=MATCH(C1,D3:H3,0)
All this works perfectly.
However, as you can see with the formula above I get back the first column number in which the search criteria appears.
What do I need to change in the formular to get the last column number in which the search criteria appears? (In the example above it would be 3)
=MAX(IF(D3:I3=C1,COLUMN(D3:I3)-3))
Or:
=MATCH(2,1/(D3:I3=C1))
Enter both as array through CtrlShiftEnter
Alternatively:
=LOOKUP(2,1/(D3:I3=C1),COLUMN(D3:I3)-3)
It should still be an array formula but you don't have to enter it as such.
I have 10000 rows of data in excel in column A & B and a new sheet with all data from column A. What i want to do a VLOOKUP from sheet 1 to sheet 2. But there are few examples in column A with 2 values in B.
Example:
Sheet 1
In sheet 2 if VLOOKUP is done for orange I am expecting 20,30
I have tried single criteria =VLOOKUP(A2,sheet2!a1,false) which worked for apple
Any suggestions how both the expected results can be done together
Not sure if it helps, but here's a solution with the formula:
Array formula in cell E2 (Ctrl+Shift+Enter):
=SUMPRODUCT(LARGE((--(IF(LEN($A$2:$A$6),$A$2:$A$6,OFFSET($A$2:$A$6,-1,0))=$D2))*($B$2:$B$6),1))
In column F you need to replace "1" (at the very end of the formula) with number "2".
A few notes:
your data set cannot start in row 1, otherwise OFFSET formula won't work.
both formulas (columns E & F) are looking for the 1st and 2nd largest number which matches the argument (column D). If the second one doesn't exist, it returns 0.
However, given the size of your data set, it is worth considering a VBA solution.
Edit: adjusted for column B = text
Use the following Array formula in cell E2 (Ctrl+Shift+Enter):
=IFERROR(INDEX($B$2:$B$6,SUMPRODUCT(LARGE((--(IF(LEN($A$2:$A$6),$A$2:$A$6,OFFSET($A$2:$A$6,-1,0))=$D2))*(ROW($B$2:$B$6)),1)-1)),"")
Similar Array formula in cell F2 (Ctrl+Shift+Enter):
=IFERROR(INDEX($B$2:$B$6,SUMPRODUCT(LARGE((--(IF(LEN($A$2:$A$6),$A$2:$A$6,OFFSET($A$2:$A$6,-1,0))=$D2))*(ROW($B$2:$B$6)),2)-1)),"")
Result:
Because I am working with a very large sheet of excel and i need to find in a specific column the last 1 before changing to 0.
is there a way to search for that ?
how to search for two consecutive cells that have 2 different values ?
If your values are in column A, put into B2:
= A2 = A1
Copy B2 and paste to the rest of column B, from B3 to next to the last value in column A.
Search column B for FALSE.