Concatenate Variable Number Of Cells?

Sep 15, 2014

I have two columns - A and B. In column A there are blank cells and filled cells. There is a blank cell and after it - a variable number of filled cells, then a blank cell again and a variable number of filled cells. I am trying to concatenate the filled cells from column A into a single cell in column B, which is corresponding to the blank cell in column A. Values should be comma delimited.

For example: A2-blank; A3-27; A4-63; A5-blank; A6-31; A7-blank .. and in column B should be B2-27,63; B3-blank;B4-blank; B5-31,B6-blanc and etc.

View 5 Replies


ADVERTISEMENT

Concatenate Variable (user Selected) Cells

Nov 14, 2007

I want to do a concatenate for multiple fields, but want the user to specify which cells should be concatenated by entering this in a few fields. What does this formula (or VBA) look like?

Let's assume there is the possibility to concatenate a maximum of 4 cells. Call the 3 cells that will be concatenated cell1, cell2, cell3 and cell4.

On the first sheet of the workbook the user enters the following:
cell1 = Sheet2!A4
cell2 = Sheet2!B4
cell3 = Sheet2!C4
cell4 = Sheet2!D4

Here are some cells and their values:
Sheet2!A4 = Hel
Sheet2!B4 = lo
Sheet2!C4 = World
Sheet2!D4 =

Upon enterring the information after the = sign for the cell1, cell2 and cell3, the formula for the concatenate becomes: =CONCATENATE(Sheet2!A4, Sheet2!B4,Sheet2!C4 ).

The result of the formula is: HelloWorld

If I now change the values of cell1, cell2, cell3, and cell4 the following should happen:
cell1 = Sheet2!B4
cell2 = Sheet2!C4
cell3 =
cell4 =

The formula for the concatenate becomes: =CONCATENATE(Sheet2!B4, Sheet2!C4).

The result of the formula is: loWorld

View 9 Replies View Related

Concatenate Or Combinate Number A Cell Into Other Cells

Sep 19, 2006

How do I get my number in one cell to show all possible combinations of it in other cells. (e.g. cell B4 = 123, now i need cells C4:H4 to display all 6 combinations of the number as follows: 123, 132, 213, 231, 312, 321). Attached is a sample file.

View 3 Replies View Related

Summing Variable Number Of Cells And Parts Of Cells

Mar 18, 2014

In my financial modelling I often have a calculated number of months of inventory. This number varies. I need to use this number to calculate the actual inventory value. For eg. it may be 3.2 months of inventory; in this case I need to sum 3 cells (current month, current month -1, current month -2) plus 0.2 of the fourth cell (current month -3)

But I may need to change the number of months of inventory to, for example, 4.2. In this case I would need the sum of four cells plus 0.2 of the fifth cell etc etc.

View 2 Replies View Related

Concatenate Non Blank Cells But Use Concatenate And Substitute Instead Of IF

Aug 11, 2013

Sampling table :

one
two
three
four
one
two
three
one
two
one

Desired results obtained via IF =IF(B2>0,A2&" , ",A2)&IF(C2>0,B2&" , ",B2)&IF(D2>0,C2&" , ",C2)&IF(D2>0,D2,"")

one , two , three , four
one , two , three
one , two
one

Is there any smarter, shorter formula via Concatenate and Substitute or other formulas ?

My closest match, but not good enaugh is =SUBSTITUTE(CONCATENATE(A2&", "&B2&", "&C2&", "&D2), ", , ", " ")
[ returna 2 commad ]
one, two, three, four
one, two, three,
one, two
one ,

View 9 Replies View Related

Sum A Variable Number Of Cells

May 1, 2009

I would like to have a cell in A2 sum up the values in cells A1, B1, C1 where the number of cells it sums is a variable in another cell that may change. I would like the same to apply to cell B2, C2, D2, etc.

This may make more sense if you look at the attachment.

View 11 Replies View Related

Variable With Concatenate

Jan 2, 2013

I have a simple task and I use the concatenate formula to resolve alot of keystrokes. I now have an issue where I have to edit that formula because of a additional character for the string won't upload into a database. Here's my example:

1. Cell A1= 12345xxxx Cell B1= 67 Cell C1= 8

I use =CONCATENATE(A1,"-000"&B1,"-000"&C1) and my result is displayed in D1= 12345xxxx-00067-0008

Easy enough! Now adding the following is the problem:

1. Cell A2= 12345 Cell B2= 67 Cell C2= 89

I use =CONCATENATE(A2,"-000"&B2,"-000"&C2) and my result is displayed in D2= 12345xxxx-00067-00089

Now D2 has one too many characters from C2

I modify the formula by reducing to "-000"&C2 to be "-00"&C2 manually but now the line items have quadrupled and manually isn't going to work for this being so time consuming.

Is there a way to use a variable with the concatenate or am I using the wrong formula period ??

View 3 Replies View Related

Average Variable Number Of Cells

Oct 28, 2008

I'm once again here asking for a smart trick to do a difficult (for me) thing. I need to write a formula capable of averaging the n cells on its left. The problem is that the number of cells to be averaged is a variable contained in anothe cell therefore the exact number is not known (a priori) and changes at every sheet refresh.

View 3 Replies View Related

VBA To Concatenate Variable Range

Oct 24, 2012

I have a problem with a worksheet that my company accounting system exports every month.

Attached : sample of the worksheet.

In column ( F ) , I need a macro to do the following calculations:
1- Check for the Title - if it begins with "Cost Center"
2- Check for the Title - if it begins with "Account Code"
3- Detect the Range Start just below "Account Code" , and End with the row above "Total"
4- Concatenate the string written in each row of the range with the string in "Cost Center"

The Story is:
Each Month I've this worksheet with hundreds of Cost Centers and subsidiary Account Codes, And to be able to analyze the accounts efficiently I need to concatenate both Cost Centers & Account Codes manually ( as you see coloring sample in the attached file ). Which led to wasting many hours , and high risk of error while copying and pasting formulas.

View 3 Replies View Related

How To Concatenate A Variable With A Range

Feb 28, 2008

Following advice from this forum I have developed the following code to save a workbook with a filename made up from Ranges within a worksheet. What I had also hoped to do was include the first 2 letters of a Range.

The code that works is as follows

View 14 Replies View Related

Concatenate And Format Variable Amout Of Data

Dec 15, 2006

I have two sheets of data, exported by a program. The first sheet uses a single row for information of each log entry. The second page will have 1 to X rows for information of each log.

What I am would like to do is combine that data into one cell, and place it in the corresponding row on the first page. This will be used in a mail merge, and I would need commas and an "and" between the data points, where appropriate for proper English. I know how to get the data together, but am having issues trying to get the correct grammar within the cell.

Willing to use either VBA or other formulas.

View 9 Replies View Related

Macro: Concatenate Text, Variable & Double Quotes

Nov 23, 2006

I need to write a line of code which puts the following into a cell:

=+C4 & " - " & 1

The cell reference at the beginning will always be C4, however the "1" at the end will be variable named "GroupNo"

So my code will be something like:

Range("B46").Value = "=+$C$4 & " & "" - "" & "GroupNo"

This isn't working. I've tried every variation of what it should be but I keep getting errors like "type mismatch" or just the wrong thing being put in the cell.

View 7 Replies View Related

To Merge Variable Number Of Cells Into One Single Cell Based On Criteria

Sep 19, 2009

Here’s an example of my data:

A B
1110AAAAAAA
2220BBBBBBBB
3330CCCCCCCC
4330DDDDDDD
5330EEEEEEEEE
6440FFFFFFFFF
7440GGGGGGG
8550HHHHHHH

I need your help to figure out how to merge the above data to look like this in new blank worksheet using a VBA macro:

A B
1110AAAAAAA
2220BBBBBBBB
3330CCCCCCCC
DDDDDDD
EEEEEEEE
4440FFFFFFFFF
GGGGGGG
5550HHHHHHH

View 10 Replies View Related

Macro To Concatenate Variable Amount Of Columns Based On Cell Value

Jul 23, 2014

I have a table that looks like:

7300
3

7301
2

7302
5

And I am trying to make a macro that will go concatenate the first 3 columns of all rows in worksheet 7300, the first two columns of all rows in worksheets 7301, etc, and insert them into column A of each corresponding worksheet.

View 7 Replies View Related

Insert A Variable Number Of Rows And Copy And Paste From And To Variable Positions

Aug 8, 2009

On the attached Excel file, I have code that will insert a variable number of rows and copy and paste from and to variable positions. That all works fine when run from a command button, but when I try to run it from the Worksheet_Calculate by entering 1 in J1 or K1 (inrange cell is J1+K1 for testing purposes) the CommandButton1_Click sub runs continously until an error occurs.

View 4 Replies View Related

Concatenate The Number Into A Formula

Oct 14, 2008

I need to do a vlookup with the array starting on a row determined in another cell, so I've tried concatenating the number into a formula but this doesn't seem to work. Is there something else that I can do?

E2 is 134

=CONCATENATE("=VLOOKUP($B2,$C$", E2+1, ":$F$2571,3,FALSE)")

returns: =VLOOKUP($B2,!$C$135:$F$2571,3,FALSE) but not as a formula, as text and I need the formula...

View 3 Replies View Related

Concatenate Values With Same Number

Feb 6, 2010

I need VBA that will make those two columns:

1 A
1 B
2 C
2 D
2 E
2 F
2 G
3 H
3 I
3 J

into those two columns:

1 A,B
2 C,D,E,F,G
3 H,I,J

View 6 Replies View Related

If Cell Has X Turn Into Number And Concatenate

Jul 4, 2009

Example is in the attch: Book11.xls. This formula works but if there is no number 4 then I don't want comma after 1, or 2, or 3, How avoid it:

results

1,2,3,4
1,2,
1,2,3,
3,4
1,
4
2,3,

(red , need to be removed)

View 5 Replies View Related

Concatenate Based On Column Number

Jun 6, 2007

I need to cocatenate anything between and including column 4 and col (unkown until macro is run)

is there a way to do this?

Basically need to add all the cells from 4th column to whatever col is. Example if col = 12

then I need columns 4 to 11 all rows together

View 9 Replies View Related

Concatenate Cell With Customized Number Of Zeros

Sep 20, 2013

I have a sheet where some data is entered in A1 to C1 and i use concatenate to string them together. The problem is in cell C1, where I used cell format to customize the number of zeros in front of the number.

EG:
A1: Photos
B1: 2013
C1: 00001

the concatenate result is Photos2013\1, instead of the desired result of Photos2013\0001.

View 3 Replies View Related

Concatenate In A Vlookup To Search For A Resource Number

Mar 4, 2010

what i am trying to do is use concatenate in a vlookup to search for a resource number and date, then return another column in the array.

the formula looks like:
=VLOOKUP(CONCATENATE(D7,$H$6),Roster_Allocation,7,FALSE)
but only results in NA.

if i search for the resource number only, i get the correct result.
also, the res# and date are concatenated in the table array. could this be related to the way excel is storing the dates (40241?) even though both concatenated fields look the same?
i have also tried adding a new coumn which has the res# and dates concatenated as the lookup value but still all NA.

View 9 Replies View Related

Concatenate Text And Numbers And Then Sort On Original Number

Jun 26, 2013

I have a data set that shows numbers for categories over time. I would like to add the data label to the numeric value and then sort the data by the original number. Is this possible?

Here's an example

A 1 2 3 4
B 5 7 4 1
C 8 0 2 1
D 3 4 9 5

I would like each column sorted independently based on the data in that column, but I want the results to have the label from column 1 concatenated with the value in the other columns such as this:

A1 C0 C2 B1
D3 A2 A3 C1
B5 D4 B4 A4
C8 B7 D9 D5

Each column is sorted by the numeric value, but has the name label from column 1 attached to it.

View 1 Replies View Related

Set Range Variable Using Variable Row Number

Mar 11, 2008

I am using a variable named " Totals" as a range type to refference the range in a formula. It works the way I have it.

Dim Totals As Range
Set Totals = [U37: AE37]

Now instead of the absolute refference, I would like to change the row refference by an offset of my current row, using a formula with a varriable. The columns stay the same.

View 3 Replies View Related

Concatenate (two Different Cells Into One)

Dec 11, 2008

I'm having a rather difficult time getting this one.

I am concatenating (is that a verb?) a bunch of cells to create an item code.
The combination of two different cells need to be able to give different values so I can dump the appropriate value into the CONCATENATE formula.

A picture is worth a thousand..

View 4 Replies View Related

Concatenate Several Cells On Tab One

Apr 11, 2013

On tab 2 of a spreadsheet, I am trying to concatenate several cells on tab one! Everything comes together in the cell on tab 2, however it does not hold the date format. It turns it into general text so just random numbers that do not even tie to the date. Any way to lock the date format for this idea?

View 7 Replies View Related

Concatenate Cells With % In Them

Apr 27, 2007

I have 7 consecutive cells which contain a %
e.g. A1 120%, B1 35% etc

I am trying to put them into one cell using concatenate
but am getting 1.20.3529411764705880.705882352941177

I would also like to separate them by comma,

View 9 Replies View Related

Format: Concatenate Value Of The Several Cells At One

Apr 30, 2009

I concatenate value of the several cells at one. (A1&"/"B1&"/"&C1 and etc. The length of characters may be different and I want it be looking neat by adding spaces. Something like that:

400/ 25/ 30
40/250/300

View 5 Replies View Related

IF OR And CONCATENATE To Read The Cells

Jun 1, 2009

I've been trying to use IF OR and CONCATENATE to read 4 cells and give me a list of parts needed based on the data loaded in the 4 cells. I attached an example showing.

View 2 Replies View Related

Concatenate A Range Of Cells (A + B + C = ABC)

Sep 29, 2009

I know how to do the "normal" type of concatenation (concatenating?), but I was wondering if there was a way to concatenate a range of cells.

If my first three cells look like this:
A1 = Adam
A2 = Bob
A3 = Chris

I'd like cell A4 to say "AdamBobChris". I'm not worried about punctuation at this point. I thought I could just do =concatenante(A1:A3), but that's not working.

View 4 Replies View Related

Concatenate The Cells On Condition?

Apr 23, 2014

I have a Requirement where we need to concatenate the cells based on conditions

i have the attachment for the reference . please download the file from the link.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved