Finding Macro That Will Combine / Consolidate Rows When Cells From 2 Separate Columns Match

Sep 26, 2013

I need a macro that will combine/consolidate rows when cells from 2 separate columns match. example...


Column A column B column C column D column E
row 1 Seminole 80 unleaded 1064 100100
row 2 Seminole 36 clear dsl 825 100100
row 3 Seminole 80 unleaded 1101 100100
row 4 Seminole 30 dyed dsl 3421 100100

This is what I need the macro to do:

Column A column B column C column D column E
row 1 Seminole 80 unleaded 2165 100100
row 2 Seminole 36 clear dsl 825 100100
row 3 Seminole 30 dyed dsl 3421 100100

View 2 Replies


Subtracting 2 Columns Of Data From Each Other When Labels In Separate Columns Match

Feb 20, 2009

I have four columns of data, as follows:

label 1, value 1, label 2, value 2

I need to create a formula in the fith column that for each line will tell excel to:

look for entry in 'label 1' in 'label 2' if there is a match, then subtract value 1 from value 2, display result.

I have tried doing this with SUMIF but am getting nowhere fast....

View 7 Replies View Related

Macro To Match Rows In Two Columns

Sep 6, 2007

need a quick macro to match rows in two columns as per demonstartion below.

View 9 Replies View Related

Transpose Multiple Columns To Rows Based On Match Via Macro Or Formula

Jul 10, 2008

I have two columns of data as follows:

10:57:42 273
10:57:42 263
10:57:42 253
10:57:42 241
10:57:37 273
10:57:37 243
10:57:37 249
10:57:37 261
10:57:37 253
11:04:47 241
11:04:47 253
11:04:47 263
10:54:31 254
10:54:31 240
10:54:31 265.......

View 9 Replies View Related

Check To See If Dates Match In Two Separate Columns?

Apr 6, 2013

what i am trying to do is look at an entire column, and see if that same date exists in the other Activity tab, if the dates match, then show the activity

here is the formula i am using, =IF($A9=Activity!$A2,Activity!$B2,"No Activity")

my problem is that i am only able to isolate one of the cells,, how do i check the entire column?

in other words, if i select two weeks, those two weeks of activity will show, if i select all weeks, all of the weeks activity will show, right now i can only get one of the weeks

my data looks like the following

1st tab
1/8/2013 - 1/14/2013
1/29/2013 - 2/4/2013
1/22/2013 - 1/28/2013


View 3 Replies View Related

Check To Match Columns Separate Sheets

Mar 20, 2007

I have a column on sheet 1 which contains 200 lines with a unique number in each row (account codes). I have another sheet (sheet 2) which contains the same column. sometimes an extra row for an extra account code is added to the col in sheet 1. I need to make sure that the col I have in sheet 2 always has exactly the same as the col in sheet one, where the same account code should never be repeated. I am currently trying to setup a sheet where I keep all the checks and controls.

View 7 Replies View Related

Finding A Match In Different Columns

Jan 3, 2009

If a number in cell M1 is also anywhere in column A (column A has unique numbers), then cell W1 (date) should equal the content of cell V (also date) in the row that that number appears in column A. If M1 is blank (or there is no match in column A), then W1 should equal V1.

In W1, I currently have...

View 6 Replies View Related

Finding Start And End Columns Using MATCH Function

Jan 22, 2014

I have a table as follows: [URL] - note: cells containing times and temperatures are numeric values, I've used custom formatting to add " mins" and "°C" on the end

In one cell, a user can input a time period (in mins), and in another cell, I would like to output the start and end columns (in letter/s) for the chosen time.

For example, in the link above, if the value inputted '30' then the start column is 'C' and the end column is 'G'. If the user had inputted '60', then the results would be 'H' and 'K', etc.

I am able to find the start column with the following equation:

I am struggling, however, to find the end column for the chosen time.

If each time had the same number of temperatures then it would be a simple case of adding the number of temperatures per time, minus 1, after the "+2".

My first idea was to copy the above function, but to change the "0" in the MATCH function to "-1", in order to find the next greatest time value. However, it appears that using "-1" in the MATCH function only works if the range is in descending order - my times are always in ascending order.

I have a further problem in that the time periods are not always the same values (i.e. it won't always be 30-60-90-120, it could for example be 30-45-60-75). So as far as I know, there is no way in advance of knowing the next time period up (and then subsequently taking one column to the left).

One possible workaround I have considered involves the following:
- Add a new row between rows 2 and 3, which has the time values in each cell (i.e. from column C, values of 30-30-30-30-30-60-60-60-60-90-90-90-120-120) - effectively duplicating the time row, but not merging cells
- Use the COUNTIF function to find the number of cells in that row containing the chosen time
- Add this value, minus 1, after the "+2" in the above formula, i.e. =SUBSTITUTE(ADDRESS(1,MATCH(VALUE,C2:P2,0)+2+COUNTIF(C3:P3,"="&VALUE")-1,4),"1","")

View 14 Replies View Related

Consolidate Rows That Have Formulas In Them But Blank With Macro

Apr 3, 2014

I am looking for some VBA programming that will allow me to use 1 button to consolidate rows (delete them). The problem I am running into is that the rows I want to delete have formulas in them so I can use "find all blank cells & delete" type of macro.


Attached are a couple of brief images on a small scale what I am looking to do.

I want a user to be able to have this sporadic list of choices, consolidate them so the are all one right after each other, then export to a word file for editing later on.

View 1 Replies View Related

Match 2 Separate Cells To A Table?

Nov 5, 2009

I would like a formula that will take the info from 2 cells (not adjacent to each other or in the same row) and then look these up in a table giving the answer in the 3rd column somewhere else on the worksheet.

View 5 Replies View Related

Combine Two Columns And Rows Into One Column

Jan 23, 2014

I need two solutions, if possible. One macro and then a "poor man's way" in case the macro breaks down the road. something where I can do it with copy/paste, formulas etc.

I will just use letters and numbers to make it easer.........

Column A might have 10 rows, with 1,2,3,4,5,6,7,8,9, and 10 as the data.
Column B might have 7 rows with A,B,C,D,E,F and G as the data.

I need column C to have 70 rows, with 1A, 1B, 1C, etc. .......through 9E, 9F through 9G as the data.

View 1 Replies View Related

Combine Multiple Rows To One Row With Blanks In Some Reference Columns

Jun 4, 2014

combining multiple rows of related data into one row but have not seen one that matches my situation. My experience level with excel only includes some basics like vlookup, match and recorded macros, although I have used vba code for a macro that met my needs. I have a parts list for a PCB that has many different parts. Some of the parts are used multiple times across different reference designations("Reference" column in the file). I have shown a desired format and the original format below. Since the item number has blanks across the reference designators I haven't found a solution that would work for me.

Desired output:


View 9 Replies View Related

Consolidate And Merge Data On Separate Sheet?

Jul 23, 2014

Trying to consolidate and Merge Data on a Separate Sheet

View 4 Replies View Related

Finding And Deleting Row With Match In Macro

Jan 13, 2007

I want to delete a row in a spreadsheet by finding the row that contains a particular value. I use MATCH on spreadsheet #1 to identify the row number on spreadsheet #2 to delete. I need the macro to select the row number on spreadsheet #2 and delete it.

I don't know the syntax for the commands in VBA to write this and I'm coming to this forum for help because I'm too lazy to learn VBA. I've recorded macros to add rows, populate cells, hide sheets, etc. The following code is extracted from a macro I recorded to try to get started, and was hoping to be able to substitue a reference to sheet1 within the parentheses at


but I can't make this work. The following is the code I was trying to adapt.

Selection.Delete Shift:=xlUp
End Sub

View 4 Replies View Related

Excel 2010 :: Separate Two Rows To Two Columns?

Feb 26, 2014

I am trying to separate two rows to two columns. How can I do this for +200 data. For example,

I need this to be:
1 Apple
2 Ball
3 Candy
and so on.

show me how I can do this for Excel 2010.

View 3 Replies View Related

Macro For Copying Cells To Columns And Rows

Sep 22, 2012

Why does my macro mess up on second line C23 and not places Play Equipment or the amount in the right column it stays on row C22



Private Sub CommandButton1_Click()
Dim SheetName As String
SheetName = "Estimate1"
SheetName = InputBox("enter the name of a sheet to use", "sheet name", SheetName)


View 2 Replies View Related

Macro To Separate Lots Of Rows With Certain Amount Of Blank Rows

Feb 15, 2014

I have been using this macro to separate lots of rows with a certain amount of blank rows.


Sub test()
Dim j As Long, r As Range
j = InputBox("type the number of rows to be insered")
Set r = Range("A2")

[Code] .......

I trying to change it so that, instead of inserting how ever many blank rows, it just copys the row above.

Example (Row A to C)

I have been messing around with macro recorder and i could select each row and paste it into the blank rows, but from researching on the internet selecting and pasting data seems to be a waste of resources (ram?) and i will be running this on a couple hundred rows (lots of data). Also, i would like to keep the functionality so that i can still choose how many times it copys/inserts each individual row from a input box.

I eventually want the data to end up like it is shown in the table but i am takin it one step at time because i want to understand what the code is doing.

View 1 Replies View Related

Macro To Find Duplicates And Consolidate Certain Relative Cells?

Feb 5, 2014

I am currently working on a project where i am given a sheet that typically has several hundred rows of data and not seemingly organized in any manner. This document has 6 columns, and my main focus is a range of dates (in MMM-YYYY form) from around early 2000 to now that can have duplicates. The dates(Column C), have corresponding Usages (Column D), and Costs (Column F) and I need to add these values together and remove the duplicate months so I only have one Usage and one cost Per month.

My spreadsheet has 6 Columns of data, and varying number of rows. Currently, since I receive the numbers in an unorganized fashion, my macro organizes the data into a table and then sorts the table be date so I have the oldest dates first and the duplicates are adjacent. There may be varying numbers of duplicates, though typically 0 to 4.

View 4 Replies View Related

Match Limitations: Not Finding Value In Cells With Alot Of Text.

Feb 9, 2007

I think Match has trouble finding a value thats within a cell containing a lot of words.

Heres the example. I'm trying to find the word "Hello world" in cell B1, in Column A.

Column A
1 Lots of Text
2 Text Text. Hello world. text text
3 Text Text

Cell B1
Hello world

Column B2

When theres only 1 sentence in Cell A2, the function works and returns 2.
However, when Cell A2 contains a few paragraphs the function returns #NA.

I don't necessarily need to use Match, if this is indeed a limitation does anyone of suggestions to work around, other than vlookup?

View 14 Replies View Related

Finding Numbers Of Rows And Columns?

May 5, 2013

How I can know the numbers of rows and columns in a excel sheet?

View 5 Replies View Related

Finding Frozen Rows (and / Or Columns)

Aug 12, 2014

Given that a worksheet has frozen rows and/or columns, how do you programmatically determine what they are?

There are plenty of examples around that tell you how to create frozen rows/columns by setting ActiveWindow.FreezePanes = True but, given this is only a Boolean value, reading it does not tell me where the freeze is.

View 2 Replies View Related

Macro To Fill Cells Of Rows Based On Two Other Columns

May 28, 2014

Data file with few columns. There are groups of similar ID numbers in Column J. For a group of similar ID numbers in consecutive rows there is only one row that has a number greater than 0 in its Column L cell and the rest of the cells of Column L for that set of similar IDs is filled with 0s.

First for that unique ID group I need to find out which row is it that has a value greater than zero in its Column L cell.

Then I need to use that value to fill the rest of the 0s in Column L corresponding to that set of Unique IDs.

The process continues with identifying similar IDs in Column J and this time doing the same thing for their Column M. I have attached a sample file that shows the data and how the results need to look like.

See here Fill Cells.xlsx

View 1 Replies View Related

Macro For Hiding Rows Containing Empty Cells Through Different Columns

Sep 4, 2013

I created a macro that analyzes some datasets and according to different parameters it puts an X at the side of every cell that goes out of parameters. These Xs are all in columns named the same way for it to be easier to find. What I want to do is to write some macro that will hide every row where the data did not go out of parameters to be able to easily see where it did. In the following example it would need to hide the second row since there are no Xs in that row. One of the problems I'm having is that the amount of columns and rows is variable.

Functional Upset
Functional Upset


[Code] .......

Below is the piece of code that I created to try to do this (G has the value for the amount of rows). I think it is working but it is either taking too long since it has to sometimes go through over 20k lines as much times as it needs to to cover all the rows that contain Xs or its getting stuck for some reason.

Worksheets(2).Range("I3:I" & G).EntireRow.Hidden = True
K = 0
Do Until Worksheets(2).Range("I1").Offset(0, K) = ""
If Worksheets(2).Range("I1").Offset(0, K) = "Functional Upset" Then

[Code] ......

View 6 Replies View Related

Macro To Combine Rows

Nov 12, 2008

I have a table which has employee names on the left handside. Next to them are contacts in a region.

View 7 Replies View Related

Count The # Of Rows In A Spreadsheet In Which There Is Non-blank Text Data In 2 Separate Columns

Dec 5, 2008

I am trying to count the # of rows in a spreadsheet in which there is non-blank text data in 2 separate columns. For instance, if the spreadsheet looked like the one below (dashes just for formatting purposes):

Mary-------some text--------some more text
John-------<blanks>---------just text here
Sue--------just some here-----<blanks>
Dave-------something--------something else

The total # of rows with something in both the "THIS" and "THAT" columns above would therefore be 2.

View 4 Replies View Related

Finding The End Of Rows And Columns And Taking Union Of Sets

Jun 13, 2013

I have a code in software that exports results to excel. But it stores the numbers associated with indices as text. I need to change all of them to numbers. So I have written the following code, that search through the folder, converts text to numbers and colses the file.

Sub ConvertText2NumberFiles()
Dim v As Variant
Dim rng1 As Range, bk As Workbook
Dim i As Long
ChDrive "C"
ChDir "C: ...analysis"


The problem is it takes time becuase it is going through A LOT OF cells. I only need at most the first 4 columns and the first 2 rows. So I wanted to use the union. I wrote the following:

Set IndexColumns = bk.ActiveSheet.Range(Columns("A") & ":" & Columns("A").SpecialCells(xlLastCell))
Set IndexRows = bk.ActiveSheet.Range(Rows("1") & ":" & Rows("1").SpecialCells(xlLastCell))
Application.Union(Range("IndexColumns"), Range("IndexRows")).Select

Which doesn't work! Morover it is only for one column and one row.

NOTE1 : Like any matrix, the intersection of index columns and index rows is blank!
NOTE2 : The lenght of indices is different from one file to another

View 2 Replies View Related

Combine Rows Into Single Cells By Condition

Mar 6, 2008

I'm importing some data from an HTML table into excel, it all formats pretty well except that some of the data appears on multiple rows.

1 01.02.06 John
2 Bob
3 Sam
4 02.03.06 Jim

What I need:

a b c
1 01.02.06 John, Bob, Sam 3
2 02.03.06 Jim 1

What I need to do is get all the items in the colum B which are listed under the same item in column a, in the first case John Bob and Sam and put them all into the same cell. I then want to delete the empty rows. It's important that this is done by testing to see if column A is blank, rather than using the date.

then in column C I want to count the items in column B,
ideally then repeat the script for the whole sheet.

Not a clue of the type of syntax I should be using though!
In fact there's probably a better way of importing the data from the HTML so it doesn't even need to be done this way! of course I'm oblivious to it. Auto Merged Post Until 24 Hrs Passes;Thinking maybe I didn't make myself properly clear....

If a cell in column a is empty then it means the item in column b needs adding to the end of the item in the row above in column b.

I then want to count the items in column b.

View 9 Replies View Related

Finding Duplicate Rows Based On Values In Multiple Columns?

Mar 28, 2014

I have a data set which has 6 columns (and lots of rows). Every row is different but I want to aggregate them based on 4 fields and then find the average of the numerical column for the results. I basically want to Group based on 4 fields and find the average of the 5th field.

My initial approach was to introduce a column which is a combination of the 4 fields I want to group by, simply in the Excel file (=A2&B2&C2&D2) and then find duplicates of that. I have a solution for this in VBA but when importing new data sets in this method is very slow, so I want to be able to do the whole thing in VBA.

View 9 Replies View Related

Adjustable Rows Via Separate Cells

Dec 10, 2013

Need to adjust the length of a countif formula from a separate cell

something like this ?


H21 being the cell i will change value to indicate rows

View 2 Replies View Related

Combine/merge Row Cells Text Between Blank Rows

Jun 14, 2009

I have a large list of text in one column which i need to combine between blank rows into one cell or a new column, the number of rows to be combined varies.

for example





would become

aa bb
ww xx zz
gg hh ii jj

I have over 30000 lines so doing it by hand is not an option.

View 9 Replies View Related

Copyrights 2005-15, All rights reserved