Excel 2010 :: Add Code To A Macro To Calculate Something Depending On Months

Aug 22, 2012

I am looking for something to calculate values based on the past three months. I already have written a macro to retrieve all of the data and just need this as an add-on.

for example, lets say it is 5/31/2012. I have a row with dates going like

10/31/2010 11/31/2010 .........

I want the formula to calculate SUM(march+april+may row 68)/SUM(march+april+may row 59)

I have an input tab where I can select the month, say 5, and get the periods.

3/31/2012, 4/31/2012, 5/31/2012

if I changed the 5 to an 8 it would get 6/31/2012 7/31/2012 8/31/2012

I don't know if i need VBA for this but I am trying to have something to calculate this depending on the period selected in the input tab.

I am using excel 2010. I am thinking something with an offset function and maybe a loop? but still not sure.

View 2 Replies


ADVERTISEMENT

Excel 2010 :: Macro To Remove Rows With More Than 12 Months

Mar 7, 2013

I am looking for a macro that will remove any rows exceeding 12 months. Each month new data is added in and I am looking to remove anything over 12 months with the new month is added.

View 6 Replies View Related

Excel Macro Or VBA To Calculate Desired Profit Margin Depending On Cost

Sep 12, 2013

I need to develope a macro for Excel to calculate desired profit margin depending on our cost of each item. Here's the scenario.

A1: landing cost
If 0

View 4 Replies View Related

Excel 2010 :: Macro To Pull AP Within Specific Zip Code?

Jun 15, 2012

I have an excel 2010 spreadsheet that lists all of our vendors and the amount we spent with them over the last year.

I want to know how many of them were local vendors.

I have a list of all the zip codes within a 100 mile radius (there are about 500 zip codes). I would like to write a macro or sort function that searches the entire vendor list and only reports back those vendors that are included in the zip codes I specify.

The columns are as follows:

A B C D E
Vendor City StateZip CodeTotal AP
Vendor 1TROY AL36082527.37
Vendor 2PHOENIXAZ85054100
Vendor 3TUCSONAZ8571416255

I want to keep the all the columns, I just want to eliminate all of the vendors that do not fall within the zip code criteria I set.

View 5 Replies View Related

Excel 2010 :: Macro Or VBA Code To Rearrange Data

Jul 5, 2012

I'm using Excel 2010 and XP. I have data in rows 1 -4 that can not be altered. There are headings in Row 5, B-L & Row 6, F-J.

Data starts in Row 7 and follows the headings. This repeats for several thousand rows. I need a way to move Row 6, F-J and put it on Row 5, M-Q

Row 6, F-J and put it on Row 5, M-Q
Row 8, F-J and put it on Row 7, M-Q
Row 10, F-J and put it on Row 9, M-Q
Row 12, F-J and put it on Row 11, M-Q
....
....
....

Then delete blank rows below Row 5

View 7 Replies View Related

Excel 2010 :: Add 12 Months To Date And Then Subtract Today

Apr 25, 2014

I'm in Excel 2010, and the cell with the date I want to work from is G22e?

EDIT: I'm trying to get the difference of the (date+12 months)-TODAY() to appear in months and days. (I also meant H22 not G22)

Here's the latest thing I tried (that doesn't work):

=IF(DATEDIF(H22,TODAY(),"y")>=1,DATEDIF(H22,TODAY(),"y")&" yrs, "&DATEDIF(H22,TODAY(),"ym")&" mths, "&DATEDIF(H22,TODAY(),"md")&" days",IF(DATEDIF(H22,TODAY(),"ym")>=1,DATEDIF(H22,TODAY(),"ym")&" mths, "&DATEDIF(H22,TODAY(),"md")&" days",DATEDIF(H22,TODAY(),"md")&" days"))

EDIT #2: I guess I should probably note that the date in H22 is the result of another formula

=EDATE(G22,12)

View 7 Replies View Related

Excel 2007 :: Calculate Total Value Depending On Certain Criteria

Jan 27, 2013

I use Windows Vista and Excel 2007.

So to cut to the chase :

On my spreadsheet, I have 6 main groups of columns, each one comprising 4 columns with their own automated calculations across the range.

Group 1: Cell H5, Cell I5, Cell J5, Cell K5
Group 2: Cell L5, Cell M5, Cell N5, Cell O5
Group 3: Cell P5, Cell Q5, Cell R5, Cell S5
Group 4: Cell T5, Cell U5, Cell V5, Cell W5
Group 5: Cell X5, Cell Y5, Cell Z5, Cell AA5
Group 6: Cell AB5, Cell AC5, Cell Ad5, Cell AE5

Then I have two columns following those: Col AG, Col AI

In each one of those two columns, I am trying to sum up a total value using The IF Function.

In Cell AG5 : the sum of the values of cells K5+O5+S5+W5+AA5+AE5,

ONLY IF the values of Cells H5, L5, P5, T5,X5, AB5 is equal to AG3 (which is a symbol (wingding 3 for capital P), this occurs 3 times out of 6, sometimes twice only, and at random, so I need the sum of 3 cells (or 2) out of 6, based on the above criteria.

Same in Cell AI5: sum of the values of cells K5+O5+S5+W5+AA5+AE5

ONLY IF the values of Cells H5, L5, P5, T5,X5, AB5 is equal to AI3 (which is a symbol (wingding 3 for capital L), this again occurs 3 times out of 6, sometimes twice and again at random, so again I need the sum of 3 cells (or 2) out of 6, based on the above criteria.

Using the formula: =IF(T5=AI3,(W5),0) , I retrieved the value of cell W5 into cell AI5; and when I tried the formula :

=IF(T5=AG3,(W5),0) , in cell AG5, it returned the value 0 which is correct again, as T5 was equal to AI3 but NOT to AG3.

But I cannot work out how to add all of the three values relating to each symbol, independently in each column, as they each occur randomly.

This is the way it looks in the spreadsheet:

Cell H5 Cell I5 Cell J5 Cell K5/ Cell L5 Cell M5 Cell N5 Cell O5/
Symbol (for P) Text Text Value /Symbol (for L) Text Text Value

And so on 4 more times across.

I could of course add it all manually for each line but I would rather have a formula to do it for me as all the other calculations are automated and/or conditionally formatted.

View 9 Replies View Related

Excel 2010 :: Pivot Table For Financial Statement With Months As Columns

Jul 4, 2012

Excel 2010. I set up a trial balance as following:

1/31/2000 2/28/2000 3/31/2000 ------- 12/31/2012
Acct # 1
Acct # 2
Acct # 3
Acct # 4

I was able to use pivot table to set up the balance sheet and income statement.

1. now each month is a field which I can choose to add to the report, but the field list is getting too long (and growing). Is there a way I can insert 1 field (for the user to input the exact date) or 2 fields (to input year and month) and the pivot table can pick up the input and refresh either automatically or manually.

2. I looked into the "group" function in pivot table, but how do I group the above data in quarterly and yearly fashion so the user can get those information quickly?

View 1 Replies View Related

Excel 2010 :: Macro To Color Code Cells Based On Value In A Cell And Range In A Table

Dec 2, 2013

I am using Windows 7 and Excel 2010.

Is there a way to create a macro to color code a cell based on the value in a cell, and then look up a value in a table, then color code it based on where it fits into the table?

I have a table of values for about 30 projects. In column g - there is a CPI value (see bold column)

Example: Project ID
Name
Program
PMT
SI ID
AC
Milestone
TCP Level
[Code] ......

Here is the table:

I have to color code a cell, base on the CPI and how it fits into the table below. So if the current Milestone is M2 or M3 and the CPI calculated is .14 the cell would be colored RED, if the CPI number is 2.01 for M2-M3 I would want cell to be colored Turquiose. If we were at Milestone M6 and the CPI was 2.01, it would be colored blue. If the CPI was .75 at Milestone M5, it would be colored Green

LEGEND
Earned Value Limits

Milestone
RED
Yellow
Green
Turquoise
Blue

M2-M3
2.15

M4-M6
1.66

M7-M11
1.26

View 2 Replies View Related

Excel 2010 :: Find Months And Days Between Today And Another Date That Is Result Of Function?

Apr 25, 2014

I'm in Excel 2010, and the cell with the date I want to work from is H22.

I'm trying to get the difference of the (date+12 months)-TODAY() to appear in months and days.

Here's the latest thing I tried (that doesn't work):

=IF(DATEDIF(H22,TODAY(),"y")>=1,DATEDIF(H22,TODAY(),"y")&" yrs, "&DATEDIF(H22,TODAY(),"ym")&" mths,
"&DATEDIF(H22,TODAY(),"md")&" days",IF(DATEDIF(H22,TODAY(),"ym")>=1,DATEDIF(H22,TODAY(),"ym")&" mths, "&DATEDIF(H22,TODAY(),"md")&" days",DATEDIF(H22,TODAY(),"md")&" days"))

I should also probably note that the date in H22 is the result of another function.

=EDATE(G22,12)

View 5 Replies View Related

Excel 2010 :: Convert Multiple Columns To Rows Depending On Input Value

Jul 6, 2014

I have lot of data in Excel 2010 which I wish to bring in Columns using a Macro depending on the input value which the macro should prompt me. For E.g.:

A1B1C1D1E1F1G1H1I1J1
12345678910
12345678910
12345678910
12345678910
12345678910

If I select data from A1 and J1 (in practical it will be more Columns) the Macro should prompt me how many Columns would be the output on Master Sheet. If the input is 2 then it should create an output Sheet "Master" and should show the following result

A1B1
12
12
12
12
12
34
34
34
34
34
56
56
56
56
56
.. ..
.. ..

It after selection I run the macro and input 3 then the output should go in three columns (A1,B1,C1) one below other. If 4 is Input then 4 Columns (A1,B1,C1,D1) will come below each other so on and so forth.

View 6 Replies View Related

Excel 2010 :: Copy Range Of Cells From One Sheet To Another Depending On Option Being Selected From Dropdown Box

Aug 13, 2012

Using macro's on Excel 2010. What I'm trying to do is create a macro that will copy a range of cells from one sheet to another depending on a option being selected from a drop down box. I've tried to use formulas but without success.
sheet 1 contains a list of approx 20 people with rows containing sales figures per week.

Is it possible to have a macro that will copy the rows to sheet2 depending on the dropdown? The drop down has already been setup with people's names

E.g.
if sheet 1, cell a1 (with data validation setup) dropdown contains "mr smith", copy sheet2 row A1:A9 to sheet 1 cell a2
or
if sheet 1, cell a1 dropdown contains "mr cooper", copy sheet2 row B1:B9 to sheet1 cell a2
etc... for each name in the dropdown

The idea is so that i select a dropdown and it copies the sales figures that match the dropdown name, if i then select another dropdown, the corresponding figures are copied to the same place.

View 3 Replies View Related

Excel 2010 :: How To Calculate Age

May 1, 2014

keep getting "The formula you typed contains an error".

To calculate a person (or anything else) age you basically subtract his date of birth from today's date. However which date functions to use depends on the amount of precision and the output format you want.

3. If we want his age in years and months, then we can use a formula like this one:
=INT((TODAY()-A1)/365.25) & ” years and ” & INT(MOD((TODAY()-A1)/365.25;1)*12) & ” months”

The output of this formula will be as follows:
40 years and 2 months.

I change A1 to G3 because that is where I the birth date.

View 2 Replies View Related

Excel 2010 :: VBA Code To Extract HTML Source Code Not Working On Google Sites

Dec 6, 2012

I have previously used the following code to successfully pull out IE webpage source code for string manipulation.

Its a crude example to demonstrate the principle:

Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public IE As Object
Sub Sample()
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

[Code] ......

However when I substitute in a Google websites address into the IE.Navigate command, the code runs to the "Source_Code = IE.document ...." line then flags up a Microsoft Visual Basic error. "Run-time error '438': Object doesn't support this property or method"

The webpage that I am trying to access is a confidential company site, so you won't be able to access it yourself, but starts with [URL] ......

The one thing that I have noticed about this website is the Privacy Report icon in the lower right status window (Picture of an eye with a restricted symbol in front). I don't know whether this is the cause of my problem, or purely an incidental observation.

Is there something peculiar with Google sites that means that the source code cannot be extracted in general, or is this an issue specific to my site ? Does the Privacy Report icon have any relevance, and if so how do I switch that off ?

Using :
MS Excel 2010
IE Explorer 8.0

View 1 Replies View Related

Excel 2010 :: DAX Calculate With Two Filters

Dec 24, 2013

Using Excel 2010

How can I use 2 filters in DAX Calculate?

I tried

MyCalc:=CALCULATE([MyMeasure], Filter(Tbl,Tbl[Field] && Tbl2,Tbl2[Field2])) It works with 1 Filter : MyCalc:=CALCULATE([MyMeasure], Filter(Tbl,Tbl[Field])) Just falls down when I add the second filter.

View 7 Replies View Related

Excel 2010 :: Calculate The Difference Between 2 Dates?

May 14, 2014

I have a pivot table and I created a formula that says:
=jobCompletedDate-jobCreatedDate

and so for example, I have
3/31/2014 7:21AM - 3/31/2014 6:33AM

and that difference is giving me: .03367

I'm not sure what this value represents......the difference in dates, converted to ??

View 2 Replies View Related

Excel 2010 :: Calculate Monthly Nights?

Nov 27, 2013

I am trying co Calculate number of nights between to dates for example 10/26/2012 -- 11/25/2013 in a period that can be greater than the month Period. for example. some One checked in on October 24, 2013 and they will checkout on december 17, 2013. in the monthly Period of 10/26/2012 -- 11/25/2013, I am trying to calculate, the monthly nights of that period itself, and the number of days he was checked in on that period.

View 1 Replies View Related

Excel 2010 :: Determine Row To Calculate Based On Statement

Jul 5, 2014

I need some different columns within a row to calculate based on a statement found in an earlier column in the row. something similar to below. there will only be two statements total which are noted on the table below.

A
B
C
D
E

1
0
0
20
5%

[Code].....

So basically If column A = disposition calculate D and E in column B but if Column A = Receipt calculate in column C

The formula for D and E is not exactly as shown just using that as a quick example. I'm using office 2010.

View 1 Replies View Related

Excel 2010 :: How To Calculate Different Factors Values Which Are Numbers

Apr 21, 2014

I am using Excel 2010 and I am trying to calculate 4 different factors' (columns) values which are numbers. Based on my analysis I will assign the value from 1-5 for each factor and at the end I have to decide the priority (a new column) adding all 4 columns' numbers. My Priority column has three criteria (High, Medium, and Low) but I don't know what formula/function to use and how. I have tried IF function but did not work.

View 9 Replies View Related

Excel 2010 :: Change Cell Colour Depending On Date In Another Cell

Jan 9, 2013

I am trying to create a sheet in XL 2010.

In Column A each cell will contain a date (differnet from other cells in that column) when inspection was last done.

Column B is when the weekly inspection is due.

Column C is when bi-weekly inspection is due.

Column D is when monthly inspection is due.

Column E is when 6 monthly inspection is due.

I need a formula to change the colour of cells B, C, D & E when each inspection is due depending on the date entered in A

I am hoping its possible that the cell colour can stay for 2 days after the due date and then return back to blank after the second day.

For example if cell A1 has a date of January 1 2013 then on January 8 2013 cell B1 turns red then on January 10 2013 the cell returns back to normal.

A1
B1
C1
D1
E1

Inspection Date
Weeekly Due
Bi-WeeklyDue
Monthly Due
6 Monthly Due

January 1 2013
Change red Jan 8 & return blank Jan 10
Change red Jan 15 & return blank Jan 17
Change red Feb 1 & return blank Feb 3
Change red June 1 & return blank June 3

View 3 Replies View Related

Excel 2010 :: Calculate Most Common Text Values By Groups

Mar 14, 2013

I want to calculate the most common text value for groups. I have a table with a lot of records like an example below.

ID Code
1 HB
1 KU
1 KS
1 LV
1 KS
2 LM
2 KS

[Code]....

I want a table like below:

ID Code
1 KU
2 KS
3 KS

How can I do it in Excel 2010?

View 9 Replies View Related

Excel 2010 :: Algebra Equations - Calculate By Grouping Like Numbers

Dec 31, 2013

I had a question about adding numbers, sort of like algebra equations (best description I can think of) into a spread sheet. Example:

Cell A1: 8
Cell A2: 8l
Cell A3: 8ls
Cell A4: 8l
Cell A5: 8
Cell A6: -where I want the total to be displayed in the following way: 16+16l+8l

Is this even possible to calculate by grouping like numbers?

View 2 Replies View Related

Excel 2010 :: Conditional Formatting Of Cell Depending On Value Of Another Cell?

May 9, 2013

I'm using Excel 2010 and I would like to format a cell (say, the font of that cell turns RED) if the value of another cell meets a certain criteria.

View 9 Replies View Related

Spread Revenue Equally Over 6 Or 12 Months Depending On Which Product Is Sold

Jul 15, 2014

We have 5 - six month programs and five - 12 month programs we are going to sell; each have a different price. I Want to insert number of projected sales manually for each month and then have excel distribute/spread revenue evenly over six or twelve months into a separate set of cells. First payment would be received at time of sale.

View 4 Replies View Related

Excel 2010 :: Getting Outlook Warning (2010) While Sending Email Through Macro

Mar 25, 2014

I am trying to send bulk emails from my excel 2010 - however I am getting a POP UP. find the screen shot in the enclosed word document So every time a new mail is sent from excel we need to press the button allow Is there a way where I can turn off this warning.

View 6 Replies View Related

Excel 2010 :: Calculate Min Number Of Employees For Jobs With Min Days To Complete

Feb 13, 2013

Im having a hard time creating the formula to calculate the min number of employees to complete a number of jobs that come in each day and need to be finished in 18 days or less.

Data that I have:

Forecast of the number of jobs for 251 days ( jobs range from 10 -80 per day) Each job needs to be finished in 18 days or less we need to staff a fixed number of employees for the whole year each employee can complete 4 jobs per day no weekends

i have excel 2010 and crystal ball

View 1 Replies View Related

Excel 2010 :: Crash - Ready Calculate Flashing Taskbar When Closing / Opening Userform

Jan 8, 2014

Excel will hang up as if it's gone into a continuous loop (Although no looping macros are active) when you open or close a user form. The task bar in Excel will flash Ready Calculate. Visual basic reports no code is running but excel either crashes or becomes very unresponsive. I have to exit and reopen excel in order to fix the problem . It also doesn't happen at any one specific point it can vary. I have various VLOOKUPs around the workbook and userforms display the correct information. I use the INDEX formula in the control source of textboxes. I also use the offset formula to make sure DTPICKER displays correctly.

I am using 'Option Explicit' at the start of all my code. I have tried a 3rd party code cleaner. No visual Basic references are MISSING

[URL]

View 9 Replies View Related

Excel 2007 :: Macro To Play Different WAV Files Depending On Value Of Certain Cells

Feb 19, 2014

I have built a darts scoreboard on Excel 2007, to track scores but also record statistics such as 3 dart average and -checkout success. As I don't know how to write macro's I've created it using formulae only - it's not fancy but does the job!

I have a number of .WAV files that call out the main scores - 60, 100, 140 and 180 and I'd like the scoreboard to play the relevant file when someone scores that amount. I've trawled through lots of forums but have been able to find one that does exactly what I need it to, and I don't know how to adjust the ones I've found.

This is how the scoreboard works:

There are 25 different sheets, one for each leg of the match that could be played. The sheets are named Leg1, Leg2, Leg3 etc.On each sheet, Player 1's scores are entered in cells J15 to J47, and Player 2's scores are entered into cells O15 to O47Once Player 1 or Player 2 wins the leg, I move on to the next sheet to play the next leg. All the scores entered remain in each sheet until the match has ended

This is what I need the macro to do:

When a score of anything other than 60, 100, 140 or 180 is entered, do nothingWhen a score of 60, 100, 140 or 180 is entered, play the relevant .WAV fileIf, for example, Player 1 scores 60 the '60' .WAV file plays. 60 will be left in J15, then Player 2 may score 100, which will be entered into O15 and should trigger the '100' .WAV file.Note that either Player 1 or Player 2 can start the leg, so the order scores are entered between column J and column O can differ.

View 6 Replies View Related

Calculate IRR In VBA Macro Code

Jul 7, 2009

I used the following statements to (try to) calculate an IRR in my VBA program and received a runtime application error 1004. Tried several variants of the statement but cannot seem to escape the error.

Dim IRRValues(12)

For iIRR = 65 To 74
For iTIGRcubYear = 1 To 11
IRRValues(iTIGRcubYear) = Worksheets("TIGRCub"). Cells(iIRR, 3 + iTIGRcubYear)
Next iTIGRcubYear
aIRR = Application.WorksheetFunction.IRR(IRRValues, 0.2)
Worksheets("TIGRCub").Cells(iIRR, 14 + Scenario) = aIRR
Next iIRR

View 4 Replies View Related

Calculate Age In Months

Nov 9, 2009

I need to be able to calculate age in months, and round whatever remainder to the middle of the month (.5). I am calculating z-scores and percentiles for in a childhood obesity project. The DoB and Date of measurements must be converted to read anything from 142.0 to 142.9 as 142.5.

This value will be used to look up the the appropriate LMS (Box Cox, Median, and Standard Deviation) in another excel table. I have to be able to compute age in months so 142.5, 143.5, 144.5, 144.5 etc. It is just not rounding off to the nearest half month.

View 7 Replies View Related







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