Comparing The Lengths Of 2 Data Rows At A Time
Jun 12, 2009
Assume there's an even number of rows containing textual data.
COL A
text1
text2
text3
text4
I would like to compare the lengths of text1 to text2, and return the row containing the greater of the two/delete the row containing the shorter of the
two. In either case, the contents below would then have to be shifted up by one. Then repeat for the next 2 rows all the way down to the last row using VBA.
View 3 Replies
ADVERTISEMENT
Feb 5, 2014
I'm trying to compare two columns of names that are different lengths. I need a formula that will return the differences. I've tried everything my nonanyltical mind can think of
View 5 Replies
View Related
Nov 14, 2008
Need a ormula that will calculate various lengths of time within a column.
For example: I would like to be able to add
02:43 (2 minutes 43 seconds) plus
01:10 (1 minute 10 seconds) plus
05:15 (5 minutes and 15 seconds)
..and accurately arrive at the sum of
09:08 (9 minutes 8 seconds)
Currently, whenever I input the value of 02:43- and assign the value of 'TIME'.. it reads it as 14:23 (clock time..not length of time.) I will only be using data that follows the format of mm:ss (minutes:seconds).
View 2 Replies
View Related
Apr 20, 2009
I have a spreadsheet containing donation data for a non-profit organization with over 25,000 rows. The spreadsheet contains a lot of data, and is sorted by donor name, donation date (when the donation was made) and the feedback date (feedback on how the donation was used).
I'm looking to analyze how many transactions were made by a donor within 10 days of receiving feedback for a previous donation. The condition to check for is
(donor name is the same) AND (donation date >= feedback data for a previous donation) AND (donation date <= feedback data for a previous donation + 10 days).
How do I best perform this comparison? For instance, a donor may have made 20 donations, so I need to compare these donations amongst themselves and flag the ones where the donation date within 10 days of the feedback date for any other donation. I need to perform this exercise for each individual donor.
View 12 Replies
View Related
Jul 13, 2007
I paste in information in Columns A-E with varying lengths for each report that I need to generate (They generally range anywhere from 10-500 rows). I have formulas already in place in the first row of Columns F-L that need to be copied down as far as columns A-E go. I recorded a macro for this when I try to run the macro for another report with more or less row entries it copies down as far as the original recording was set. How do I make it so the rows will copy down just as many as I need and not some arbitrary number of rows? This is my first post so if any clarification is needed that's no problem.
View 3 Replies
View Related
Nov 11, 2009
(Core starting issue solved but other threads were created to continue with trouble spots.)
I'm terrified to use VBA just yet, so right now I'm determined to highlight values in my spreadsheet just using conditional formatting.
I have 5 plus 1 columns of data. For example,
A B C D E....F
3 2 4 5 7....2
4 6 1 3 4....1
4 7 4 5 8....4
2 1 5 3 9....1
I successfully applied a MIN formula to compare between columns on each
row and display in F the MIN value. Notice each cell going down F has the
minimum value in analyzing across each row.
Now, I *also* want to apply a formula on the whole F column to compare these resultant MIN values
and give me the MINIMUM value between those as well, so now I'm comparing across
rows. Got it? Now then.....I want the ENTIRE row that has this MIN value in F to be highlighted, because that will be the best choice for the application of what I'm doing. Did you understand this paragraph. It might have been confusing, but I think I said everything correctly, so read it carefully.
I've tried all sorts of "Formula is", "Cell value is", dollar sign this, dollar sign that, no dollar sign this, <, >, =, highlighted ALL the block of data, highlighting JUST the column across the rows of which will be compared, only highlighted one cell, but nothing has worked.
Is my problem that you can't have 2 formulas in one cell? So then I thought I should ADD another condition, but nothing works.
Let me throw in one more element that I did not state. If anywhere down the F column there is a 0, I don't want that to be my minimum. I want it to evaluate and give me the minimum value greater than 0.
Please read everything I wrote carefully. It might be confusing, but I hope someone has an answer, because it sure has frustrated me.
Now, I'm thinking that VBA programming may give me answers, but I am so terrified of macros, I don't know how to begin that. I have this impression based on the many sites I've looked at on the internet that many people do macros and it's quite easy, but it's funny to me that I am so scared. There's something about me freaking out that I won't have a period or a quote in the right place and I'll stress my day away over it.
View 14 Replies
View Related
Jan 26, 2010
I've got a list of donor names, names listed multipled times in Column A, each row with different donation data. For instance:
Sheet 1
A1 - Mary Jones, B1- Internet Donation
A2 - Mary Jones, B2 - Silent Auction Purchase
A3 - Mary Jones, B3 - Event Ticket Purchase
A4 - Gary Jones, B4 - Foundation Grant
A5 - Gary Jones, B5 - Internet Donation
A6 - Sara Parker, B6 - Event Ticket Purchase
I want Excel to compare rows A1 and A2, and if the name has not changed, enter the donation data from Column B into another sheet that will just list that person's name once:
Sheet 2
A1 - Mary Jones, B1- Donation1, C1 -Donation2, D1 - Donation3
A2 - Gary Jones, B2 - Donation1, C2 - Donation2, D1 - Donation3 (which would return no value because there the name changes
Does this involve IF, MATCH or VLOOKUP formulas?
View 9 Replies
View Related
Mar 27, 2013
It is currently 11.40 AM. When I evaluate
Code:
?Now() > TimeSerial(11,30,0)
I get True.
However, when I evaluate
Code:
?Now() < TimeSerial(11,50,0)
I get False.
Why is this?
View 9 Replies
View Related
Aug 19, 2014
I have a performance extract from a system which has performance for multiple accounts but the data is off different lengths and shown vertically. I wish to move the data onto a new sheet but rotated(transposed) horizontally
Attached is a snapshot of the report that is usually about 20,000 lines. See input and output tabs.
Is there any way that a macro could be created to do this.
Performance.xlsx
View 3 Replies
View Related
Jun 25, 2013
I am half way through writing a bigger macro, but am stuck at this stage.
I need to copy from a block of data as shown:
However, this column varies in length each time, and I only want to copy down to where the entries stop.
I also only want to copy W1:X6, and columns Y, AA, AB, AD (but only down to the end of the column)
I've tried using the End(xlDown)).Copy function, but obviously this doesn't work with the block up the top and the gap between the block and the columns
View 4 Replies
View Related
Apr 18, 2007
I need to copy cells M6 to S6 down to all rows in a worksheet. The columns will remain M to S. The number of rows however vary in each worksheet.
How do I get the macro to read "End Down" with varying number of rows. I will need to do other functions also using "End Down" so if possible is there a generic code for this.
View 9 Replies
View Related
Jan 20, 2008
a way to separate out data that has been all entered into a single column
code .....
The above information is a sample of the data. The data has been entered into 1 column, column A.
I want to separate the entries in to 1 column each for vehicle ID, full journal description, actual journal, EE code, Report total and equipment description.
View 9 Replies
View Related
Aug 27, 2008
I'm having difficulty allowing my macro to run in a more global environment with varying data-set lengths.
For example:
Though the following "copy" scenario works for me when my data set is contained within cells B2:B35:
Range("A2:A35").Select
Selection.Copy
It does not allow me to work with a set of data that extends beyond this--say to B50 or B60. Is there any way to allow this command, and others, to be a bit more flexible with my data set lengths?
View 9 Replies
View Related
Jun 19, 2006
I'm trying to write a macro that compares 2 coloms(open,close) of dates/times and calculates how long each was open for. This is what I have so far. I've also include as an attachment an example of the date/time format i'm using.
Sub Time()
Dim A, B, C As Long
Sheets("Sheet1").Select
For i = 7 To 5000
A = Fix( Range("A" & i).Value)
B = Fix(Range("B" & i).Value)
C = A - B
Cells(C, i).Value = C
Next
End Sub
View 9 Replies
View Related
Feb 28, 2014
I have thousand rows of data in the following format:
Despatched Time
Batch
Date
Time
Amended Time
20/4/2013 3:45:00
1
20/4/2013
03:45
[Code] ..........
'Date' is generated by =IF(A2="", "", TRUNC(A2))
'Time' is generated by =IF(A2="", "", IF(E2 = "", A2 - TRUNC(A2), TIME(LEFT(E2,LEN(E2)-2),RIGHT(E2,2),0)))
And sometimes I may want to change the Time, so I used another column 'Amended Time' to insert a 4-digit value to do so.
I want to arrange them into batches according to the hh:mm, so for the column 'Batch', I used the following formula:
=IF(D2 = "", "", IF(EXACT(D2, D1),MAX(B$1:B1),MAX(B$1:B1)+1))
The problem is, when I changed the time by inserting 4 digits in 'Amended Time', the time value is actually different from those generated by TRUNC(), so even two cells have the same time '03:46', the time value is not exactly the same and so they are arranged into different batches (please refer to the following table).
Despatched Time
Batch
Date
Time
Amended Time
20/4/2013 3:45:00
1
20/4/2013
03:45
[Code] ..........
View 9 Replies
View Related
Jul 15, 2009
This workbook is designed to prompt the user with inputboxes allowing them to enter a name, hyperlink a file to that name, and then a date. Next all the drawing names are read into an array and stored. Along with some minor sheet formatting, this is what happens when the button "Add Drawing" is clicked.
Next, when the button "Revise Drawing" is clicked, the user will be prompted with an inputbox for a drawing name. This name will be compared to the names in the array. If the name is found, the row containing that drawing will selected and the user will be prompted to update the hyperlink, then the "drawing date" will be moved to the right by one column, then the user will be prompted for another date replacing the date that was moved. The first sequence of commands or button works fine. The button "Revise Drawing" prompts the user with the inputbox requesting the revised drawing name, then develops the runtime error 1004.
View 3 Replies
View Related
Jun 27, 2014
I'm trying to compare cells in 2 sheets, and if those cells are equal, I want to select the whole row that the cell is in, and copy it into a third sheet.
[Code]....
View 5 Replies
View Related
Dec 14, 2011
I have 100 Rows of Data with 2 Columns.
The left contains data input and the right Columns contains certain formula.
How do I set it up so that the worksheet can eg. Calculate 5 rows and rest 1 Second and continue this way until it reached the end of the rows? (Number of rows is not fixed).
View 5 Replies
View Related
Mar 13, 2007
the system works by whoever has the most points wins.. i already have my formulas and everything done..
i want the excel program to move the entire row, if possible, by whoever has the most points to the top..
(i.e If ryan d. has the most points he will be is vince v.'s spot)
can this be done automatically in excel or do i have to do it by hand?
View 9 Replies
View Related
Mar 25, 2013
I need to hide the rows in an excel whose value is equal to the array list that has been already hardcoded...How to do this...
View 1 Replies
View Related
May 29, 2014
I am facing a problem in evaluating a problem. I am referencing from the screenshot of excel file. I want to replace the values of Column-C for which column-A matches with column -G. And, the remaining will remain same.
Capture.jpg
I am also attaching the excel file.
View 5 Replies
View Related
Jul 18, 2013
I have two groups of lottery results. The first group has the last year results of 200 rows, and the second group displays this year results of 100 rows. I want to start comparing the first row of the second group (green group) with all the rows of the first group( blue group)
View 12 Replies
View Related
Jul 2, 2014
I'm trying to compare the values of columns B and G and if any of the cells are G < B, I would like to move the whole row into the second worksheet. And only if possible, it would be awesome if the macro could check column A for duplicates before the value comparison and sum up the column B if there are duplicates. In my example row 6 and 7 on column A have the same suppliers code and the amount totals to 2.
In this case for example, the value of the third row of G is lower than B, and therefore I would like the whole row 3 to be cut out from worksheet 1 and moved to worksheet 2.
Original view of sheet 1:
SUPPLIERSCODE
ORDERAMOUNT
PRODUCTNAME
BARCODE
SUPPLIERSCODE
WAREHOUSE STOCK
And then cut out the rows in which G
View 9 Replies
View Related
Jan 8, 2014
I have A:1 - X365 filled with hourly energy prices for 2013. I need to convert these to a single column - A1:A8760. I have tried writing some code and some macros with no success.
If I were to do it manually 365 times, the macro would look like this:
Copy Row A1:X1
select sheet 2
Paste Special > Transpose (fills A1:A24)
repeat for rows 2-365
Tried using this from a previous post, but it takes A1:A24 then B1:B24 and so on and makes them a single column - so it doesn't work unfortunately.
Sub MakeColumn()
Dim rng As Range
Dim LastRowSrc As Long
Dim LastRowDst As Long
Set rng = Worksheets("Sheet1").Range("A1")
[Code] .....
View 3 Replies
View Related
Nov 26, 2012
I'm new to macros and VBA so I am wondering if it is possible for a macro to compare values in column B of sheet2 and column B of sheet3 and for the values that DON'T match i.e. unique values to column B of sheet2, copy row from sheet2 to sheet4? This will aid my processing time drastically if I can copy all the rows from sheet 2 to sheet 4 where the model number in column B of sheet 2 doesn't appear in column B of sheet 3!!
View 3 Replies
View Related
Jan 18, 2014
Essentially what I want to automate is a check through one list on the Sheets("Notes") in column A, with another column B on Sheets(template). If there is a match I want to insert a part of the row that the match occurred on Sheet("Notes"), and insert it above the row where the match occurred on Sheets(template).
Here is my code so far, currently I keep getting a "Application-defined or object defined error" on the line
VB:
Sheets("Notes").Range(Cells(i, 2), Cells(i, 11)).Copy
VB:
Sub add_notes(template As String)
Dim Rng As Range
Dim i As Integer
[Code].....
View 5 Replies
View Related
Apr 6, 2014
I have data from Columns A to D. I want to do the
following:
1. Look for duplicates in all column A
2. For each duplicate found in column A, check if all values in column B are also duplicate.
3. If the condition in (2) is satisfied, compare column D for all the rows; select the row with the minimum value in column D, and delete the other rows.
For example:
A B C D
Row1: Abby 04/01/2014 7:00PM 0.98437
Row2: Sam 04/01/2014 9:00PM 0.35627
Row3: Abby 04/04/2014 7:00PM 0.68932[code]....
View 13 Replies
View Related
Feb 6, 2014
I'm trying to compare 2 worksheets with the same headers(NAME, ADDRESS, CONTACT NO...). What codes should I use that when there is a duplicated row in worksheet A and worksheet B, it will be deleted and when there are 2 names with different addresses and/or contact no, the whole row in file A will be obtained. Output should also be in another worksheet. It goes like this.
worksheet A
NAME ADDRESS CONTACT NO
JOE ABC 123
MIL XYZ 567
NIK LMN 234
NED QRS 456
[Code]...
So the output should be:
worksheet C
NAME ADDRESS CONTACT NO
JOE ABC 123
MIL XYZ 567
NIK LMN 234
NED QRS 456
JIM JKL 345
SAM FGH 789
Is this possible in vba?
View 1 Replies
View Related
Oct 13, 2006
I am working on formatting a spreadsheet report where the values will change in column A. Here is what I would like to do via a Macro. Compare the cells in column A (e.g., compare A2 to A3, compare A3 to A4, and so on). If the values between the two cells in column A are different, insert three blank rows and set the active cell to the next cell following the blank lines. Example:
if cell A5 is different from A6, insert three blank rows below row 5 and new active cell is now A9 and the comparison would start again. I have been trying to code the macro for this but with no success. Here is the macro I have been working on.
Sub Macro1()
Const NumRow As Integer = 3
Dim StartCell As Range
Dim RowNR, NewCnt As Long
Dim RowCount As Long
Dim Count As Long
Dim intRow As Integer
Dim bFmtComplete As Boolean
RowCount = Application.WorksheetFunction.CountA _
(Range("A1", Range("A" & Rows.Count).End(xlUp)))
bFmtComplete = False
RowNR = 2
Range("A1:J1").Select
' Rows("1:1").Select
Selection.Copy................
View 4 Replies
View Related
May 17, 2014
I have a parent spreadsheet with raw data(with errors) and a child spreadsheet without errors. I want to merge the child into parent. (:{). I am thinking of comparing multiple columns from each sheet to ensure maximum accuracy. And when those columns match up we paste the corrected column data from child sheet to parent one. I am using windows 7 and Excel 2010.
View 1 Replies
View Related