Macro To Sum Data Based On Criteria

Aug 17, 2012

I have a data which i need to total based on document types.

Document types in cells are AB=CELL A1, ZR=CELLL A2, ZP=CELL A3,
SK= CELL A4.And amounts in rows 555=CELL A1, 625 = CELL A2,
725= CELL A3, 925=CELL A4 and so on.

My challenge is to get all the total of ZR,SK,AB type of documents using macro.Initially i used this formula, however now document types are more than one.

=SUMIF([Book1]Sheet1!$C$2:$D$4,"zr",[Book1]Sheet1!$D$2:$D$4)

View 6 Replies


ADVERTISEMENT

Macro To Fetch Data Based On 2 Criteria?

Oct 22, 2013

Attached is my .xls with dummy data Fetch data By Director.xlsx.

My intention is that once the Director and Month in tab 'By Director & Month' is chosen and the Fetch Data commandbutton is clicked, a new workbook should open.

This new work book should have :

all entries in tab 'Monthly Invoice Input' for that Director-Month combination,along with a sum total of column Q(Total invoice amount) in the last row.

View 6 Replies View Related

Macro To Copy Data To Other Sheet Based On Criteria...

Feb 19, 2009

We're working with a large workbook with data from A5:P20000 on sheet1.

I need to be able to pull data from sheet1 to sheet2 based on the invoice number in column A on sheet2.

Sheet2 will have different invoice numbers in column A, some of these invoices numbers are in column H on sheet1. I need excel to find these invoice numbers and copy the data from that row on sheet2 to the row with that invoice number on column2.

Example:
Sheet2 A5 has invoice number 1234457
This same invoice number is located on sheet1 H3400
Need to copy to sheet2 (starting in cell B5) the following cells from sheet1 (B3400, C3400, E3400, G3400, H3400, I3400, J3400, K3400, M3400, N3400).

View 15 Replies View Related

Macro: Copy Data Based On Criteria/Condition

Oct 16, 2006

Attach is a sample of my project. I have to loop through B9:B80 in sheet("Raw Data") and capture the value of each cell. EG:

* if Value captured is 120A --> check with sheet("SP14F") from the row which contains the same value.

* i have to check that the aperture, outer and inner values of Layer 120A and so on..of the Raw Data sheet is the same as that of in the SP14F sheet.

* if the values are not the same, change the font to red

i understand that this task requires looping and arrays.

View 4 Replies View Related

Macro: Count Data In Range Based On Criteria

Nov 10, 2006

I have a list of several ranges defined in vba, and i am trying to find which range a cell containing word is in excel. Im am looking for help for a good way of doing this.
For an example: Say I have 2 ranges defined, the first range corresponds to column A, the second to column B (just an example). The word "Dog" is written in cell B15. I want to find out in vba what range "Dog" is in. I would like some vba code to check and find either if it in a given range (boolean) or a way of checking a list of ranges and returning which it is in. The word will only appear once on the spreadsheet. I have played around with the find command (A=range.find(Pl), then check if A exists) but i havent had any luck (I get an 'Object variable or With block variable not set) I tried searching for a while, but was having trouble finding something related to what i am trying to do.

View 7 Replies View Related

Macro To Count Based On Criteria

Sep 11, 2006

I have ahseet with the following columns:

Col 1 = Item Description
Col2 = Price
Col3 = Discount Rate

I would like to gather a count on another sheet of all instances in col 1 where it is equal to 'Fridge' I know I can use the SUMIF function but I would like to do it in VBA code.

View 5 Replies View Related

Pull Data From Sheet Based On Criteria - Populate UserForm And Ask For Missing Data

Feb 8, 2014

I have a spreadsheet that is updated weekly -- but every week new info is added that needs a user to input corresponding info. I use a vlookup function to link to another spreadsheet that populates the info from previous weeks and the info that is missing shows up as #N/A...

First I was using a msgbox function to get the info:

HTML Code: 

For Each b In myrange
If Application.IsNA(b.Value) Then
Employee = b.Offset(0, -2).Value
SSID = InputBox("Please enter ID# for " & Employee & " :", "New Employee Found")
b.Value = SSID
End If
Next b

But it can be up to 30 different new employees... and that is time consuming.

I would like to make it more user friendly by creating ONE userform that displays all of the employees as labels -- has a text box in which to put the ID # -- and then has a drop down box to choose the type of employee (2 options). I want all of that info to go back to the reference spreadsheet so it will be saved for following weeks, and then redo the vlookup to get the info into the new weekly spreadsheet (I can do that part)....

HTML Code: 

Private Sub CloseButton_Click()
Unload UserForm1
End Sub

Private Sub ComboBox1_Change()

[Code] ......

View 2 Replies View Related

Macro To Delete A Range Based On Certain Criteria

Jan 22, 2009

I have a table of data with which I need a macro to clear a range of data based on certain criteria. I have attached a file as an example. In this example the current period is 6. I therefore need to clear columns which have a period of 7 or higher.

Essentially, if the current period is x, then clear the range in the period columns if the period is greater than x.

View 6 Replies View Related

Insert Row Macro Based On Cell Criteria

Jan 29, 2009

I'm trying to create a macro that takes data from one row and inserts it into a new row. Attached is a workbook with a before and after example of what I'm trying to do.

Each row has a security transaction that includes principal cash and interest. The data needs to be formatted so that each transaction has one row for principal and one row for interest.

Principal is identified by the tran code PAYDOWN in column C. Interest is identified by the tran code INT. However, the raw data generated includes both interest and principal under the tran code PAYDOWN.

There could be 100 or 1000 transactions generated based on the day.

View 2 Replies View Related

Macro To Move Cell Down A Row Based On Criteria

Feb 20, 2009

I would like a simple macro that would actually move a cell based on criteria. In my case it would be: In row A, if a cell starts with 'Agent Name' then that cell needs to move down one cell replacing the contents of that cell.

View 3 Replies View Related

Macro To Split One File Into Many Based On Criteria

May 16, 2011

I have a file, with this dummy data

Fruit Country QTy
Apple India 100
Apple USA 200
Orange India 150
Grapes Aus 100
Grapes India 100

I need to macro, wherby it will create 3 files namely apple, orange,grapes and store the relevant rows.

Hence I need a macro to split file into different files based on different values in a column and accordingly name it .

View 9 Replies View Related

Macro To Color Cells Based On Criteria

Jul 27, 2009

Column DColumn EColumn FTarget %DifferenceCash4%5.12%Large-Cap8.5%1.73%Commodities4%-1%

I need to color code Col F based on the following criteria:

If F2/E2>20%, then shade pink else no color. I only care about the absolute values. The 20% number can change depending on the category. So for commodities, the limitation is 30%. Like that I have a list of about 20 asset classes, 14 of which have the 20% constraint, rest are either 25% or 30%. I would like the cell color to be updated each time I import a file. Also I have other conditional formatting on Col F (like red color if negative number) so I don't know if another conditional format will work on the same cells?

View 9 Replies View Related

Create Charts From Same Data But Each Based Ob Data Criteria

Aug 31, 2006

Hi, have a question regarding dynamic charts, specifically I am trying to create several dymanic charts based on data in a single column (So i can only say my first set of data will be starting a a set location in the chart, the rest has to shift down based chart data above it). This data should organized in charts depending on the data in several other columns. For instance, need to pull out values from column based some ID and some PartNumber. A sample excel or VBA would be much appreciated. I know VBA but do not know Excel VBA much.

View 9 Replies View Related

Macro To Delete Rows Based On Multiple Criteria?

Jul 10, 2014

A macro is required to identify rows within a selection e.g. entire column A, that share the same value, then delete appropriate rows depending on the values in another column. The attached example details the requirements.

Extract Rec1.xlsx

View 6 Replies View Related

Macro To Delete Rows Based On Multiple Criteria

Apr 9, 2009

I need a macro to delete old data from a large selection of data, in order to keep the size down.

What I want this macro to do is

Check all rows from 5 downwards.

If A5 (date) is less than cell $B$1 AND B5 is not equal to C5 then delete the whole row.

Continue until reaching the bottom.

View 9 Replies View Related

Macro To Select Multiple Files And Copy Them Based On Criteria?

Mar 10, 2013

This is what I am trying to achieve:

1) Prompt user to select a file (or multiple files)

2) Copy the files that meet certain criteria to a folder

My attempt (fail):
VB:

Sub FILES2SFTP() Dim FileNames As Variant Dim I As Integer Dim fso As Variant Dim Data As String ChDrive "G:" ChDir "G:TEST" Data = InputBox("Enter the date", "Enter the date", Format(Application.WorksheetFunction.WorkDay(Date, -1), "yyyymmdd")) Set fso = [code]....
I get error 424 object not found in this line:

If fso.getfilename(FileNames(I).Name) = ("Name1" & Data & ".xls" Or "Name2" & Data & ".xls") Then

View 3 Replies View Related

Excel Macro / VBA That Will Hide Rows Based On Multiple Criteria

May 23, 2012

I would like to hide rows for data that does not meet specific criteria. For example: If a user selects room number 101 from a drop down in B1, I want to filter data in range A3:F1000 to show me only room 101 rows (A column) where C column contains a value larger than zero OR D column contains a value larger than zero OR E column contains a value larger than zero. I do not want it to return rows where 101 may be in other columns beside A.

Sample:

A B C D E F
__________________________________
1 ROOM: 101
2
3
4 101 XX 1.2 0 0 P
16 101 YA 0 0 1.1 L
23 101 JJ 3.2 2.1 0 L
55 101 JJ 0 0 1 P

So, if a row contains 101 in column A and all three values in columns C, D, and E equal 0, then those rows will be hidden.

View 8 Replies View Related

Macro To Compare 2 Lists Based On Multiple Criteria Using SUMPRODUCT?

Feb 27, 2014

I want to compare 2 lists in separate sheets based on multiple criteria and delete the duplicates

Sheet 1 - new list in column A:E
Sheet 2 - old list in columns B:F

So here is what I need: the macro should generate single IDs made of Sheet 1 Ai,Bi,Ci,Di,Ei cells for each row i to the end of the list + generate single IDs made of Sheet 2 Bi,Ci,Di,Fi

If . Evaluate (Sumproduct (IDs made of Ai,Bi,Ci,Di,Ei from sheet1) & Sumproduct IDs made of Bi,Ci,Di,Ei,Fi from sheet2) >1 then delete the entire row in Sheet 2.

This will leave me with only updated items (rows) in Sheet 2

View 1 Replies View Related

Counting Macro Based On 2 Criteria (Horse-racing Spreadsheet)

Jun 21, 2006

Horses have 5 running styles; early speed to late closers; denoted as 1 to 5 in column Z. I'd like to count those noted as 1 thru 3 for each race.

In column FC (the last column with data) I have a race ID # for each race on the spreadsheet, somewhere between 2500 to 5000 races in each one. They're a monthly record. The race ID # is a concatenation of columns B (Track ID), C ( Date) & D (race #). Each is unique to its race. E.G. Aqueduct, jan 1st, 2004, 2nd race is id'd as AQU379872.

Would it be possible to create a macro that would (A) count the number of horse 1s, horse 2s & horse 3s from a specific race ID & then post those numbers in columns FD thru FF & (B) then continue to the next race ID in column FC & count those horses from that race & so on thru the entire spreadsheet?

Would it be simpler if each race ID were changed to a number--race 1 down to race 2500?

View 9 Replies View Related

Extract Data Based On 3 Different Criteria?

Jun 28, 2010

I have a data sheet with 20 columns and about 300+ rows. In the results sheet there are 3 criterias (from column A, B, H in datasheet) which are in the form of dropdown in cell A1, A2, A3.

I would like to extract the data from the data sheet based on the criterias selected from dropdown list, to results sheet starting from row 6, with only 12 headers out of 20 (non-continuous, e.g. columns A-C, E, G-K etc.)

View 3 Replies View Related

Return Data Based On Criteria?

Dec 19, 2012

generating a formula that takes into account a range of values (an entire row) and from this row, I would like the formula to select, for example anything greater than 80%. After the formula selects anything greater than 8, I would like for it to select cells that are above or below the cells that have values greater than 8.

1
2 JLKNSTTP
3 85934942
4
5

For example, in the above datas, I would like a formula to select anything greater than 8 in row three and select cells above it. In this example it would be j, k, and t.

=if((3:3>8),offset(A3,-1,1,1))

View 1 Replies View Related

VBA To Populate Data Based On Criteria?

Jul 16, 2014

I need to populate data based on criteria.

The criteria has been attached as follows.

Sample Test.xlsx

View 2 Replies View Related

Data Validation Based On Two Criteria

Feb 16, 2009

I need a data validation to prevent entries when they are > 50, but only if the value of another cell in col A is "Payment". The value of 50 is an example, I have another formula to get this number using VLookup.

The idea is that if the value of the cell in col A is "Income", I don't want the entry to be rejected. But if the value in col A is "Payment" or "Transfer" and > 50, I want the entry to be rejected (if I only have $50, then the payment cannot be > 50).

View 7 Replies View Related

How To Paste Data Based On Criteria

Feb 18, 2012

I have a problem and I hope that it can be solved using a macro. Basically, I have a set of data in column A and B in sheet(1):

A
B
1NameDate
2JOY12/09/11
3MAR12/12/11
4DAVID12/12/11
5

I have another set of data in Sheet(2):

A
B
C
D
E
1NameDatesalary
CHARACTERRATINGS

[code].....

basically, I would take into consideration the names and dates in sheet(1) and if it matches sheet(2) then it would then paste their salaries, characters and ratings into sheet(1).

View 9 Replies View Related

Pull Data Based On Two Criteria?

Nov 14, 2012

i have a sheet that i have been creating to pull information based on two things. The criteria is an emplyee # and the second is a date.

The data needs to be organized onto Sheet4. The Employee # will already be on Sheet4, so i have been trying to use that with Vlookup / hlookup with no success as i can't seem to get it to find the correct Date and place the data correctly.

Sheet4 layout:
Completed (with respective data from Sheet2)

A
B
C
D
E

1

[code]....

the data is located in Sheet2 (Emplyoee # is always in Column A, and the Date is always in Column B).

the data needs to be pulled into Sheet4. Essentially making the horizontal data of Sheet2, Vertical on Sheet4 under the respective date column.

Sheet2 Layout:

A
B
C
D
E
F
G
H
I
J

[code].....

View 3 Replies View Related

Counting Data Based On Two Criteria?

Aug 29, 2013

I have data in my worksheet as follows

table.tableizer-table {
border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif
font-size: 12px;

[Code]....

I want to create a sum of all values in column B (Data Size) that correspond to the same Dept-div code in column A

Ex: 0667 the total should equal 43268.8 for the two cells.

I need to count all cells in these columns versus a specific range?

View 2 Replies View Related

Extract Certain Data Based On Criteria

Nov 30, 2006

I have a raw database that contains various data all in one column and I only want to extract certain data to a new column. All I want is to extract the time, like 14:00, 14:15, 14:30, etc...... from column "A" and populate column "D" if it meets this criteria.

I have tried everything I can think of, very difficult yet it seems to be so simple.

The "date" is really a date format but the "time" is really text.

Here is what the data looks like:

Column A has....

Name1:
Name2:
Name3:
10/16/2006
14:00
14:15
14:30
14:45
15:00
10/27/2006
16:30
16:45
17:00

View 9 Replies View Related

Counting Data Based On Criteria

Aug 11, 2008

I have a spreadsheet that has Leads in column H for eg Advertisements and Presentation dates in column K

I need to set up a formula that will count the number of dates (Items) in column K that is applicable to the item in column H for eg Advertisements, Referrals etc . There can also be blank items in column K which can be ignored

View 9 Replies View Related

Count Data Based On 2 Criteria

Aug 27, 2006

I've looked at the various examples in a search of topics simillar to my topic but I still can not get thsi to work.

I have a work book that contains 2 sheets

Sheet1 is called RawData of Multiple columns
Sheet2 is a quick report basded on Sheet1 data.

I need to find a way to do counts where 2 criteria are met.

Example.

Count the number of Times the phrase Major Victory appears in column M
( Range M1 to M50 ) of Sheet1 IF the value in Column L ( Range L1 to L50 ) of Sheet1 = USA

I tried this:

=COUNTIF(RawData!M1:M50,B1( AND(RawData!L1:L50=$A1)))

I am using B1 and A1 ( from Sheet2 ) as search criteria

but it gave me 0 ( and I know this is wrong ).

Based on the reading I did on simillar topics it appears that I cannot use CountIF in this case.

View 9 Replies View Related

Print Data Based On Criteria

Dec 12, 2006

I have a sales workbook, with three sheets. Ongoing, Won, Lost, all potential sales are entered onto the Ongoing sheet and Ongoing is chosen in a column that has 3 options - Won, Lost, Ongoing, until brought to closure by winning the sale or losing it at which point Ongoing is changed to Won or Lost.

The products for sale are Audio, Video and System and at the top of the Ongoing sheet it totals those three categories as Won, Lost or Ongoing.

What I want the workbook to do is when the status of the sale is changed from Ongoing to either Won or Lost, the entire row is moved off the Ongoing sheet and placed on the appropriate Won or Lost sheet, and the totals at the top of the Ongoing sheet calculated accordingly.

One of the columns on the Ongoing sheet is 'Progress' in which a short abbreviated explanation is input of next steps of the sale. When the sale is closed, and hopefully automaticall moved to it's appropriate sheet, I'd like this text to be changed to either Won or Lost.

View 4 Replies View Related







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