Comparing Data In Multiple Rows

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


ADVERTISEMENT

Comparing Values In One Column And Inserting Multiple Blank Rows

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

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 View Related

Conditional Format Comparing Data Between Rows

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

Comparing Multiple Types Of Data

Jul 18, 2009

In one excel book I have 2 sheets.

1. One sheet (request type wise) contains request type and the phase which it belongs to. eg request type A belongs to phase 1 and request type B belongs to phase 2. (like wise there are 212 request types divided into 8 phases)

2. The second sheet contains raw data (request type) where the request types are randomly arranged.

What I am trying to do is:

Compare the raw data of sheet 2 with standard data in sheet 1 and paste the phase to which it belongs to with a help of macro/code, since the standard data (212 request types with 8 phases) is huge.

View 9 Replies View Related

Excel 2010 :: Comparing Multiple Columns Of Data (Last Name / First Name)

Aug 8, 2012

I'm using Excel 2010 on Windows 7.

I have 2 worksheets. One has Employees and the devices they have. Last name, First Name, Device each in their own colulmn. Many have more than 1 device so they have multiple entries on seperate rows.

Another worksheet has Employees and thier location. Last name, First Name, Location. Again, all on seperate columns.

It would look something like this

Sheet1
Lastname
Firstname
Device
Johnson

[Code]...

So I'm tasked with combining them into 1 sheet with last name, first name, device and location. The issues I'm having are:

1) A team member could have multiple devices
2) A last and/or first name can appear many times, so a simple Vlookup against lastname won't work - it has to somehow also compare against both.

View 6 Replies View Related

Comparing Customer Names In Rows And Returning Text Data In Different Cells If Same

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

Multiple Ccolums/rows To Get Data From Multiple Columns/rows (vlookup)

Jan 15, 2010

I have created a spreadsheet to show some reports and I wanted to serch for some datas which overloops themeselves. If you can have a look at a test file I attached you will see the full picture. I have 2 tables, where the 2nd one is on the right side of the 1st one. 1st table:..............

View 3 Replies View Related

Comparing Multiple Columns In Multiple Sheets

Apr 13, 2009

I'm trying to do is develop a formula to:
- look at one column in sheet 1 and if a value in that column equals a value in another column in sheet2. then, display an X

View 6 Replies View Related

Comparing Rows In 2 Sheets?

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

Sorting Rows By Comparing Cells ...

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

Comparing Multiple Cells

Feb 11, 2009

I have two excel files. The data is arranged by column. I want to take 3 or more cells (from three different columns) from a particular row and match them up with three cells (in 3 different columns but in the same row). The three cells should be in the same row. However the matching row may appear in a different order in each of the two lists. When Excel finds a match, I want it to return true. How can I go about doing something like this?

I have attached a file explaining what I mean. I am trying to match the three cells in list one with three cells in one of the rows in list 2. However the number of cells in each list is different and there are some cells in list 2 which are not in list 1 and vice versa. There may also be extra columns, which I have not included for the sake of simplicity.

View 2 Replies View Related

Comparing Multiple Columns To One

Dec 22, 2006

I have data in column A which is the correct data. I also have data in other columns that I would like to compare to column A. If the data is the same, then it moves beside it, if not then it leaves a blank cell.

I have looked for macros and formulas to do this for ages but i cant seem to find one. Here is an example

BEFORE

A B C D
1 1 2 1
2 4 3 2
3 5 4 4
4 7 5 6
5 - - 7
6 - - -
7 - - -

AFTER

A B C D
1 1 - 1
2 - 2 2
3 - 3 -
4 4 4 4
5 5 5 -
6 - - 6
7 7 - 7

View 9 Replies View Related

Comparing Multiple Thresholds

Jan 12, 2007

See the attached spreadsheet. the range D5:D20 is dependent upon the value entered in D2. the range K4:K64 contains all values I would like entered into D2. For each value entered in D2, the range E21:H21 calculates 4 statistical values. I would like these entered into the 4 columns in Table 2 (L,M,N,O). The first value has already been done. Can I automate this somehow to plug in all the threshold values I have listed in Table 2 (column K)???

View 2 Replies View Related

Hiding Particular Rows By Comparing Values In Array?

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

Comparing Two Rows Replacing Values In Columns

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

Comparing The Rows In Different Columns And Displaying The Results?

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

Comparing Cell Values And Moving Whole Rows?

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

Comparing Two Columns With Multiple Variables?

Apr 8, 2013

I am working on a survey analysis and I'm having trouble comparing two columns.

Ex. 100 surveys
Column A being age (scale of 1-5)
Column B being willingness to pay (scale 1-5)

I am trying to correlate age with willingness to pay by saying =countif(a1:100 = "1" and (B1:B100 = "1" and "2"))
Basically checking to see if the 1st age group has a strong willingness to pay; I would repeat with B1:B100 = "4" and "5".

View 2 Replies View Related

Comparing Multiple Variables On Same Line?

May 19, 2014

Is it possible to modify the sub "Continue" below so that the "If s.Name <> wsKeep" line compares multiple variables? The code is for the purpose of setting a workbook to a required state, i.e. hide all worksheets except ones stated in variables. I have further subs that would also benefit from me knowing how to do this.

View 2 Replies View Related

Comparing Multiple Cells To The Same Array?

Feb 26, 2014

I am trying to find compare the value in one cell with an array of cells. My problem is when I try to carry the formula down to the next line - my array changes as well. For example:

Before
After
01915

[Code].....

So, if Before is Column A and After is Column G, the formula I have right now is =INDEX(A2:A3349,MATCH(G2,A2:A3349,0)). When I try carry the formula down to G3, G4 and so on, the array changes as well.

View 4 Replies View Related

Copy Rows Based On Comparing Values In Columns

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

Macro To Generate Outlook Emails With Data / Information From Multiple Rows Of Data?

Apr 30, 2014

I am attempting to create a macro to generate emails based on data in a sheet. The goal is to run the Macro, and have it generate emails to send to contractors letting them know what they are going to be paid. For instance:

Name in Column J
Email in Column L
Memo in Column N
Balance in Column T
Due Date in Column P
Week Ending Date in Column H

Now what I would like to happen, is to tie a macro into a button that will create the email as follows:

To Field: Email address from Column L
Subject: "Company Payment Remittance Payment Date *Date from Column P*"
Body: Hello *Name from Column J*,
For *WE Date in Column H* you will be paid *Balance from Column T* for the time worked of *Memo in Column N*

Now the tricky part is that I want the email to contain all line items for each email address. So instead of sending one email per line, have the macro automatically put all of the information that needs to be sent to one email address into the message. I don't know if that is possible, but it sure would make my life easier if it was.

I have attached a sample workbook of the data that will be used

Example Workbook for Email Macro.xlsx

View 1 Replies View Related

Converting Horizontal Data To Vertical Data With Multiple Rows?

Sep 8, 2009

reformat a table in which data for each named person is presented in one row with mutiple columns into a table in which each named person has multiple rows and one column of data. The solution to to this has eluded me so far.

The attached example shows before and after.

View 6 Replies View Related

Comparing And Sorting Multiple Column Groups?

Feb 28, 2014

I'm am trying to take multiple column-groups and sort them by product ID number.

I am trying to put together a sales record for the past 26 months for around 2000 different items and sorting them manually would obviously be a nightmare.

I would like to sort them so that all the drugs with the same NDC (prod ID) have the correct data for each month displayed on the correct row for that NDC. Right now I have each set of data for that month sorted by product ID number but some months we used certain products and others we did not. Is there any sort of Macro that I could use? What I am trying to do I attached two files. The "before" and my desired "after".

starting point.xlsx
end product.xlsx

View 1 Replies View Related

Comparing Multiple Ranges With Conditional Logic?

Apr 23, 2012

[1] compare (row) ranges across two columns with an unequal number of rows (column A [number] to column C [number])
[2] save each result of [1] where there was a match in column B
[3] for each row where there was a match (now stored in B), compare the value from the same row in column D (date) with the same row of column F (date), and store the result in column E
[4] count and message box the final number of matches from column E

Data Example:

A B C D E F
----- ----- ----- ----- ----- -----
12345 match 12345 11/1/2011 match 11/1/2011
77777 34345 ... ...

A and C numbers match, so check same row date in D that does match date in E, place "match" in E, then count and display.

Sub other()
Dim range1, range2, range3, range4, range5, range6 As range
Dim x As Variant, y As Variant, z As Variant, a As Variant

[Code].....

View 1 Replies View Related

Comparing Two Columns On Different Worksheets And Adding Rows Where Matches Occur

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

Macro For Deleting Duplicates / Comparing Rows And Retaining Minimum Value?

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

Comparing Entire Rows Within 2 Worksheets And Then Display Output In Another Worksheet Using VBA

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

Display Data By Criteria Has Multiple Rows Of Data

Mar 10, 2009

Need in displaying data by user input criteria, mulitple rows of display also need to display to blank out when no criteria is input. In example spreadsheet the criteria cell is B6 in "Results" page and needs to pull in data from the "Database" page.

View 3 Replies View Related







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