Vb Macro Code For Calculating Sum And Average Of Rainfall For Each Year?

Mar 5, 2014

I need to calculate SUM and AVERAGE of rainfall for each and every year separately and must be displayed separately in a separate column. For your easy understanding, I have done manually and attached the excel sheet.

View 6 Replies


ADVERTISEMENT

Calculate The Daily Average Of Rainfall At A Time?

Feb 16, 2014

I have a set of 7 years daily rainfall data. I need to calculate the daily average of rainfall from this 7 years data set. I don't wanted to calculate it by for example copying and pasting the first day rainfall of each year rainfall to a new sheet and average it for all the days. I need to calculate it all at a time.

View 1 Replies View Related

Macro Or Excel Function For Calculating Average

Apr 16, 2014

Excel function or macros for calculating the average of waterSD column where the TT column is less than or equal to 100(red markings). functions like IF TT IS LESS THAN OR EQUAL TO 100, THEN CALCULATE AVERAGE OF WATERSD....

I had done manually on the right side in the attached excel sheet. only those yellow markings.

Because already I have some macro which do this process but it is not accounting for the TT column less than 100. it starts from 200 TT values. but i need to include 100 TT also. That's is where now we have yellow markings. I will provide you the macro code if you can edit that where it will start calculating form 100TT value, it will be really great. The code is,

[Code] .....

Attached File : average for watersd OF 100TT.xlsx‎

View 3 Replies View Related

Macro To Change Year In VBA Code

Oct 31, 2013

I have a macro called pull that contains a year several times -see sample code below

I woulsd like a macro that will prompt and enable me to change the year from say 2013 to 2014 on the Macro called "Pull" . I intend to set up button to link to the macro

With Workbooks("Fruit & Veg Dept Commisions.2013.per Budget.xls")
With .Worksheets("Service")
Set cfind = .Cells.Find(what:=CDate(mmonth), lookat:=xlWhole)
.Cells(9, cfind.Column) = x

[Code] .....

View 2 Replies View Related

VBA Macro Code For Calculating Averages Those Which Have More Than One Value?

May 2, 2014

I need vba macro code or excel function to calculate average for some intervals in my excel sheet which have more than one value... I need all those values to be get averaged and placed in one cell...

I have intervals like 0-2, 2-4, 4-6.... 22-24.

In these intervals, few have got more than one values like

16-1804/11/201416:29:2616503.9902
04/11/201417:52:4917390.0293
18-2004/11/201419:52:5517204.8086

Now I need 16503.9902 and 17390.0293 need to get averaged and placed in one cell like,

16-1804/11/201416:29:2616947.00975
18-2004/11/201419:52:5517204.8086

View 14 Replies View Related

Macro Code To Get Saturday And Sunday Dates On Inputting Year

Jan 16, 2014

I am looking for Macro code preferably to get list of dates with Saturday / Sunday in a separate columns which falls Saturday and Sunday on imputing the year.

View 5 Replies View Related

Calculating Rent By Year

Dec 12, 2006

I have attached the spreadsheet in a pdf. I can e-mail it to anyone who is is willing to help me.

I am trying to calculate the amount of income per calendar year from each tenant.

I have, for each tenant, a commencement date (the date that the first lease year began) and a termination date (the date the last lease year ended). If a tenant has signed a 10 year lease, for example, and his lease commenced on February 15, 2005, then it will terminate on February 14, 2015. The 10 years in that range each have a different rent for that year. Year 1, (from February 15, 2005-February 14, 2006) he will pay $4k a month. In Year 2, (from February 15, 2005-February 14, 2006) he will pay $6k a month. What I want is a set of columns that show the total rent he will pay in 2005, 2006, and so on. The 2005 total should be: $42,000 (10.5*$4000). In 2006, it should be: $69,000 (1.5*4000 + 10.5*6000), and so on to year 10 (being split between 2014 and 2015. Also, please note that the lease could commence on any day of the month and they pay the corresponding pro-rata share of rent based on the number of days into the month the Lease Year is starting/changing.

The result should look like this:

[2005][2006]
[$42000][$69000]
next tenant amounts
next tenant amounts

View 14 Replies View Related

Average Of Range In Macro Code

Sep 30, 2006

I have to make VBA codes to get the average of two ranges. The problem is I always get 0 value. The value of each cells came from the formula that's why I use .TEXT. Here is the code.

iAveragePrep = WorksheetFunction.Average(Range(Cells(275, 4).Text), Cells(275, 5).Text)

View 8 Replies View Related

Calculating Business Fiscal Year

Sep 1, 2008

writing a formula that would result in my organizations' business fiscal year.

Assuming the fiscal year is 2008, the quarters are as follows:

1st QTR = 7/2007 - 9/2007
2nd QTR = 10/2007 - 12/2007
3rd QTR = 1/2008 - 3/2008
4th QTR = 4/2008 - 6/2008

When 7/1/2007 is entered, the result should be Q1-2008
10/20/2007, Q2-2008 and so forth.

View 13 Replies View Related

Calculating Dates In Year And Month

Jan 24, 2008

I trying to find a formula to give the difference between two dates in year and month.

For example, the start date is Feb 1 2006 and end date is Jan 1 2008.

The formula should result in 2.11

I tried the following formula from a previous thread but it gives the answer in text but I need it to result in 2.11.

[url]

View 9 Replies View Related

Calculating Prior Year Info

Jul 23, 2008

My Financial year runs from Oct to Sept. My current month is June 2008 and the YTD Expenses is in Cell P2032. I have set up a formula to calculate the prior YTD Expenses as sum(AU2032:AM2032) This is for the period Oct 2006 to June 2007. When I do July 2008, I would like to the formula to caculuate the prior YTD Exp as sum(AU2032:AN2032)


How can I get the formula to Change Automatically based on the Month & Year as per the example shown above?

View 9 Replies View Related

Macro Code That Takes Average Of Next 24 Cells Down

Feb 4, 2013

I have this one query though in regards to loops.

I am trying to create a macro that can take the average of the the first 24 cells within a sheet, place the answer onto a cell in the next sheet (e.g. sheet2 in cell A1), then go back to the previous sheet, take the average of the next 24 cells within the sheet and paste the average of this new set in A2. I want to create a loop that will do this 365 times.

I have only managed to create the following code, however its only obtainning the average for the first set of 24 cells starting from B6 in sheet 1. I dont know how to use offsets that well....

VB:
Sub Oval1_Click()
For i = 1 To 365
Sheets("H1 - Riser Turret pressure").Select
Range("B4").Select
ActiveCell.FormulaR1C1 = "=AVERAGE(Sheet1!R[2]C:R[25]C)"
Range("B4").Offset(1, 0).Select
Next i
End Sub

View 6 Replies View Related

Formula For Calculating Partial Year Interest

Feb 4, 2014

I have developed a financial calculator that asks the user for the "input date" which is used to record balances as of the input date. My interest calculation for the first year is based on the current date compared to the input date. For example, if the user is keying in a current balance of 10,000 @ 10% interest, and the "statement date" or "input date" is 12/30/2013, and the current date is today, 2/4/2014, then it should calculate interest for the entire year of 2014. It is not doing that. It calculates $3 interest.

But if input date is 6/30/2013 with current date of 2/4/2014, it seems to work OK. It calculates interest of $504 in that case. It appears to get messed up with the year transition between current date and input date. The formulas I have listed below appear to work fine except when the input date is 2013 for the year and the current date is 2014. The formula does not "see" that input date was last year. There must be a minor tweak to formula I am overlooking.

Cell C2 = Today's Date=TODAY()
Cell C3 = Input date (user keys in date in mm/dd/yyyy format)
Cell E2 = "translate input date to year format" =DATE(YEAR(C3),12,31)-C3
Cell E3 = Investment Rate
Cell G2 = yr 1 interest rate adjusted =(E3/1)*($E$2/365)
Cell C21 = Current Balance
Cell D21 = Interest Yr1 = C21*G2

I need the interest calculation to account for partial year accrual.

View 3 Replies View Related

Add AVERAGE Formulas To Cells Using Variables In Macro Code

Apr 15, 2008

I am trying to have the formula =( SUMIF(S2:S125,">0",S2:S125))/(COUNTIF(S2:S125,">0")) Put into cells through vba. What I did to get the formula is typed it into an excel cell to find the average of a group of cells that do contain blank cells. The formula brought out the proper results. So all I did is put the formula into vba and changed the appropriate parts. The range will not be the same of course, but there is what I have.

ActiveCell.Formula = "=(SUMIF(" & ActiveCell.Offset(orow + 2, 0).Address & ":" & ActiveCell.Offset(-1, 0).Address & ","">0""" & "," & ActiveCell.Offset(orow + 2, 0).Address & ":" & ActiveCell.Offset(-1, 0).Address & "))/(COUNTIF(" & ActiveCell.Offset(orow + 2, 0).Address & ":" & ActiveCell.Offset(-1, 0).Address & ","">0""" & "))"

When I show a msgbox for ActiveCell.Formula (Msgbox activecell.formula), it shows me the formula as above - =(SUMIF(S2:S125,">0",S2:S125))/(COUNTIF(S2:S125,">0")) Except instead of the s:ranges, it shows $L2:$L125 (which is correct). The quotes do show up around the criteria in both the sumif and countif. I keep receiving an error. I put a msgbox err.description & ", " err.number dialog in. The error comes up as ", 0" (no quotes).

View 2 Replies View Related

Calculating Totals From A Date Range On A Rolling Calendar Year?

Feb 25, 2010

I have a spreadsheet that tracks “points” for hourly associates on a daily basis that totals weekly and monthly. This spreadsheet works on a rolling calendar year instead of a fiscal and I need to be able to capture the totals for periods of time by days.

For example, I would need to view how many points ‘employee x’ has from 2/25/09 through 2/25/10. I have attached the spreadsheet, which includes tabs for each week ending and a summary page.

View 4 Replies View Related

Calculating Number Of Days - Differentiate Between Leap And Regular Year

Jun 10, 2014

I need a formula that will calculate the number of days (ex from 10/1/08-1/1/12) and will differentiate between leap year and a regular year. I am trying to calculate interest between 2 dates and leap year is calculated on a different interest rate. Right now I have it set up so I have to manually type in the leap years in a separate field instead of being able to just you point a to point b.

View 2 Replies View Related

Macro Code To Average Multiple List Of Varying Column Ranges

Apr 4, 2009

I have a spreadsheet that has two different data sources (i.e., A and B). The amounts of these data sources (i.e., the number of columns) varies from sheet to sheet. I have to calculate the averages of these data sources independently and together. Because this data is spread across twenty or more spreadsheets, these calculations can be time-consuming. I want to do the following:
1. Locate the last occurrence of the first data source "A" in row and then insert a column after that cell.
2. In that cell, I want to get the average of each data source for each row of data (i.e., there are always 19 rows of data).
I want to do the same two steps for the second data source "B". Then, I want to insert a column after the "B" average and this column will be used to get an average of each row of data from A and B together. Please keep in mind that the number of data sources for A and B varies from sheet to sheet.
So far, I am working on code to try to " find" the text in a range (i.e., find the last instance of "A"), but I cannot figure out how to get it to get it to stop at the last occurrence and then insert a column. I have some ideas about how to calculate the average, but any of yours are much appreciated.
Also, the row with the type of data (i.e., A or B) is named because this function is part of a larger macro. Therefore, it is relatively easy to get to it.
I have attached a version of the file that displays how I want it to look.
The code I have thus far is:

Cells.Find(What:=A, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate

View 9 Replies View Related

Average If Data Is In Same Month Of Same Year?

Jun 4, 2014

So I have some data that I would like to have average only if that data was entered in the same month and year as specified in another cell. What I have tried so far is:

[Code] .......

-RenewalMonths is a dynamic range where each cell in the range shows the month of the date in that row.
-RenewalYears is the same but for the years.
-RenewalOverallStuff is a dynamic range where I would need to average the data that meets the criteria.

View 2 Replies View Related

Highest 3 Year Average Over A Span Of Ten Years

Mar 15, 2007

I have a list of people with 10 years of salary history for each (in ten consecutive columns on the spreadsheet).

I need to calculate the HIGHEST 3 consecutive year average salary for each (if they have less than 3 years with salary, then it should just average the years the do have, be it 1 or 2 years).

Here is the kicker: some people have breaks in service (for these years, there is a blank in that entry). These years should be ignored and skipped in calculating the avergaes.

So if someone had salary figures in years 1, 2, and 4, but a blank in year three, the average of years 1, 2, and 4 would constitute one three year average (whether or not it is the highest is a whole other matter...).

I have been round-and-round the best way of doing this. I was thinking of maybe creating a UDF that calculates a three average, then do it up to 8 times (one for each starting year) in 8 "helper columns", and taking the highest average.

View 9 Replies View Related

Finding Average Based On Month And Year

Aug 4, 2009

I have 5 years of data in 2 columns:

Col A. Col B.
8/2/2004 Value 1
to
7/31/2009 Value n

I have a table set up as follows

1 2 3 4 5 6 7 8 9 10 11 12
2004
2005
2006
2007
2008
2009


I was wondering how I could construct a conditional statement to pull the associated values with the given month and year in the table...

I tried the following to no avail... I'm just getting a zero value:

=AVERAGE(IF(MONTH(J6:J1255)=AC$35,IF(YEAR(J6:J1255)=$AB37,K6:K1255)))

View 9 Replies View Related

Calculating A Rolling Average

Oct 8, 2009

I have several worksheets with thousands rows (independent variables) and hundreds columns (all dependent variables). Each line basically gives me hundreds values for each independent variable - see below:
...
C9 39.65 653.95 5.28 163.56 99.56 14.49 ... ...
E9 7535.92 21500.56 2835.88 3122.98 7225.34 5371.25 ... ...
G9 111568 298021 12940 31645 181797 36996 ... ....
...

I need to know how the values in each row are distributed, and I ideally plot a 2D column graph of the distribution. Is there a way to do that and create/program a macro (with relative button on the workboook) that does it automatically once clicked?

Very often there are outlying values (bigger or smaller by a factor of 1000 or even more), mistakes, which I would like to identify and fix possibly

View 10 Replies View Related

Calculating Average Of A Range

Oct 9, 2009

What could be the syntax (in a code) for averaging a range in col C. the range values are given in E3 and E5. (E3=508 & E5=1200) These values changes each time I open the workbook.

View 2 Replies View Related

Calculating Average Of 2 Averages

Jun 7, 2013

I have a spreadsheet that we are using as a Skills Matrix for the team. The area that the team member deals with is listed in Row 3. The scores for each person are recorded in Columns D to M. The process steps being scored against are in Rows 8 to 38, and are seperated by the area of responsibility.

I am trying to work out the average scores of each person depending on their area of responsibility. I can work out the totals easily enough using:

=IF(ISNUMBER(FIND("CM",D3)),SUM(D11,D12,D13,D14,D18,D19,D20,D23,D24,D25,D26,D27,D28,D29,D30),0)
+IF(ISNUMBER(FIND("V",D3)),SUM(D33,D34,D35,D38),0)

But if I use the same for the average scores is works fine until a person covers two duties:

=IF(ISNUMBER(FIND("CM",D3)),AVERAGE(D8:D10,D12:D17,D19:D22,D24:D30),0)
+IF(ISNUMBER(FIND("V",D3)),AVERAGE(D31:D32,D34:D37),0)

This is becuase it adds the 2 averages instead of working out the total average score. Is there an easy way around this?

i.e. For team members who have CM in Row 3 I need an average of certain cells, for team members who have V in Row 3 I need a different average and for those team members with both CM and V I need an overall average.

View 1 Replies View Related

Calculating Average From Averages

Oct 1, 2013

I have a database with monthly tabs and a summary sheet, on the summary sheet I calculate an average length of stay for each month (tab) but I need to find the yearly average and I don't know if there is a formula that would calculate the true average by using the monthly averages.

View 2 Replies View Related

Calculating An Average From Letters

Feb 11, 2008

I have a table with 9 columns filled by a letter (A, A-, B+, etc). This letters correspond to grades (4, 3.67, 3.33, etc). The tenth column is supposed to contain the numerical average of all 9 letters in the line.

View 9 Replies View Related

Calculating Average Values

Jul 28, 2006

I created a pivot table in which sales amounts are represented and a derived table in which market share percentages are showed. Now i am looking for a formula that is able to calculate average market share values. Depending on which country i selected in the pivot table and which category, the number of active companies are changed. How can i formulate this formula to calculate average market share percentages in a certain period. check out my attached file to clarify the situation.

View 2 Replies View Related

Calculate The Highest 5 Consecutive Year Average Salary

Feb 1, 2013

Example.xlsI have a list of people with 10 years of salary history for each (in ten consecutive columns on the spreadsheet). I need to calculate in excel the highest 5 consecutive year average salary for each (if they have less than 5 years with salary, then it should just average the years the do have). Some people have breaks in service (for five years, there is a blank in that entry). These years should be ignored and skipped in calculating the avergaes.

View 3 Replies View Related

Formula Show The Grade Average As The Year Progresses

Jul 15, 2006

I have a very basic Excel Gradesheet that's designed to simply record letter grades, and show the grade average as the year progresses. I've hit a snag with problem in the formula which shows a grade of "F" - when the grade range can only be that shown on the table (A+ to E-). I've attached the Excel sheet so you can see what I mean.

View 8 Replies View Related

Average With Conditional Month, Year And Date Range

May 8, 2008

I collect unique prices each day. I am trying to find a way to determine the average of the numbers collected from the 21st of the previous month to the 20th of the current month. This formula will need to calculate for multiple months and years. So for example, I need Feb2008 average-which would be the average of numbers found between Jan21-Feb20, I then need Mar 08 average which would be data from Feb21-Mar20 etc. My spreadsheet is setup with the first column having the dates (ex. 01/01/08, 01/02/08 etc) and the second column containing the value for that particular date ($2.85, $3.00 etc).

As the number of days between the 21st and 20th change each month, I just can't seem to find a way to do it without a whole lot of manual effort.

View 9 Replies View Related

Calculating Average Excluding Cells Containing <?

Jan 26, 2014

I am trying to calculate an average of 800 cells, where I would like to exclude a cell when a certain character is in it, namely "<".

View 4 Replies View Related







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