How to concatenate columns in excel using a formula having conditions? - excel

I want to concatenate columns A, B, C and D in column E. But the concatenated cell should contain the data of all the columns with some extra text.
e.g. Suppose column A contains "11/01/1997", B contains "ABC", C contains "20" and D contains "B+". Then E should contain "DOB: (data of A column), Name: (data of B column)" and so on.

Unless I have misunderstood:
In the top row with data in (could be row 1 or row 2 if you have headers on the data)
Put = "DOB:" & A1 & ", Name: " & B1 ...
(Substitute 1 for 2 or whatever row you are on)
Drag this formula down the e column - this should do it for each row.
Ok?

Related

Can I use Excel CELL output in function calls

I have 2 columns (A & B) of non unique Names and Values, sorted alphabetically by Names. From this I make a column of unique names (J).
For each unique name I get their first and last cells in column A using
Start Cell: CELL("row", INDEX($A:$A,MATCH($J2,$A:$A,0)))
End Cell: CELL("row", INDEX($A:$A,MATCH($J2,$A:$A,1)))
So I end up with columns J, K and L:
J K L
Name1 1 10
Name2 11 27
So I now know
Values data is in column B
the start row is 1 and end row is 10
I want to get the minimum for B1:B10
I can concatenate the string "=MIN(B1:B10)" but how can I execute it in a cell?

I need a pattern in excel for certain columns

Pattern Example
Column B: 8 times of cells in Column A
Column C: 8 sets of same cells repeting till the end of Column B
Column B
=INDEX(A:A,(ROW()-1)/8+1)
Column C
=MOD(ROW()-1,8)+1

Counting instances across ranges in columns

I am creating a spreadsheet for my personal use. I need to count the number of times one column's values are equal to an adjacent column's.
Is there any way to do this in Excel without having to modify the formula every time a new row is added?
If you have column A and B now, add column C:
Column A Column B Column C
1 2 =countif(B:B, A1)
2 2
3 1
Then just copy the first value in column C, select the entire column C and paste :)
You will get:
Column C
1
2
0

Sum of multiple columns if they match

I have this table of data:
A B C D E
003B1016 1 003G1016 1 003B1016
003G1015 1 003G1391 2 003G1015
003H0121 4 003H6208 2 003H0121
003H6209 1 003H6209 1 003H6209
I want to sum B+D if A and C are identical , how would i do that?
I have another 32000 rows of data. :) Thanks for the help
Put this in cell E1 and copy down:
=IF(A1=C1,B1+D1,"")
This says - if A = C, then add B+D. Otherwise, return blank "".
EDIT for new requirements
In order to add all amounts from column B where column A matches the current row and from column D where column C matches that row, where the row in column A exists anywhere and the row in column C exists anywhere, do the following formula in E2 and drag down:
=IF(ISERROR(MATCH(A2,A$1:A1)),IF(ISERROR(MATCH(A2,C:C,0)),"",SUMIFS(B:B,A:A,A2)+SUMIFS(D:D,C:C,A2)),"")
This says: look above the current row in column A - have we seen this item before? If no, continue with the formula. If yes, ignore, to avoid double counting. Then, Look at all of column C - does the value in the current row of A occur anywhere in column C? If no, then don't add anything. If yes, Add all items from column B where column A matches the current row, and add all items from column D where column C matches the current row.

Spreadsheet: If row in sheet contains 2 criteria then get value of cell

Sheet 1 gets values from Sheet 2.
Sheet 2 has hundreds of rows, but only 4 columns. (Cols A & C are names, Cols B & D are numbers).
Cell XX (sheet 1): Looks in Sheet 2, For "Bill" (col A) and "Jill" (col C) where they BOTH appear in the same row, then returns number from col B (from row where "Bill" and "Jill" are found) to Cell XX in sheet 1.
If "Jill" is in col A and "Bill" is in col C - then conditions are not met, and do not return value.
How do I write this?
I am so confused. PLEASE, someone help me?
Lookup Sheet 2 For "Bill" (Col A2:A300) AND "Jill" (Col C2:C300) Get number in Col B.
One solution is to create a helper column E. Use this formula in the first row (i.e. cell E1):
=$A1 & "-" & $A3
and fill this down for the other rows. If ColA = "Bill" and ColB = "Jill", then ColE will be "Bill-Jill".
You can then do a MATCH to find out with row has "Bill-Jill", and pick up the corresponding value from ColB:
=IF(ISNA(MATCH("Bill-Jill";e:e;0));"No match";INDEX(b:b;MATCH("Bill-Jill";e:e;0)))
The MATCH formula will find out which row contains "Bill-Jill", and the INDEX formula will pick up that row from another column. MATCH will return #NA if there isn't a matching cell, and this will be captured by the ISNA check.
I'm not sure if OpenOffice supports the MATCH function - it's definitely part of Excel though.

Resources