Subtotal VBA Based On Spaces At Start Of Cell

May 2, 2014

I am looking to subtotal specific cells. Basically it is a download from a data base and I have designed an input area for other users to input their predicted figures. But I am trying to put an automatic subtotal for each area depending on the spaces at the start of the cell. I have got a very longwinded formula to get the right subtotals in other files by categorising each line in another file. But I am looking for a vba code to put a simple sum() or sumif() in the relevant areas. I have included some of the categorisation I have had to use for my other formulas.

View 3 Replies


ADVERTISEMENT

Add Spaces Based On Cell Value

Mar 31, 2014

I'm trying to add rows based on the numeric value in column I. For an example, if I2 value is 2, add 2 rows below row 2 and keep the same interior color. Is it possible???

View 2 Replies View Related

Start Macro Based On Cell Value?

Nov 8, 2013

Code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("A1").Value = 4 Then
Call CBLPH

[Code]....

I am trying to create a script that will start a specific macro based on a cell value. I have a drop down menu with 16 options. so if cell A1 = 4 run one macro. if cell A1 = 6 run a different macro.

View 9 Replies View Related

Subtotal Based On Another Column

Feb 23, 2012

I have a problem Im wanting to subtotal a range of filtered totals based on column A. Basically skip any filtered total where column A is blank

Column A Column B
735512172626

So when using subtotal 109 it will skip 5 as there is no figure in column A

I am currently using the below code to create the subtotal.

LR& = Sheets("Sheet1").Range("H" & Rows.Count).End(xlUp).Row
With Range("H" & LR& + 2 & "," & "I" & LR& + 2 & "").Offset(3, 0)
.FormulaR1C1 = "=SUBTOTAL(109, R[-" & LR& & "]C:R[-1]C)"

View 6 Replies View Related

Subtotal Based On Criteria

Sep 22, 2007

I have a list of numbers that I wish to subtotal. I have tried the Subtotal function within Excel, but that is not giving me the format that I need. I have 4 columns. The Column A consists of account numbers.

I want to subtotal the debits and credits in Columns B & C, respectively, grouping them by the account number and then the date in Column D.

For example, after the solution, there would be a single line for each account number with the total of debits and credits per date (if there were debits and credits on multiple days, there would be totals for each day's transactions).

I am attaching an example to help visualize my situation.

View 4 Replies View Related

Subtotal Each Group Based On Changes In 1st Column

Oct 28, 2009

Need to insert 2 blank rows and sum columns (Columns B & D; range varies) based on cell value change (Column A). In attachedment I have before and after examples.

View 6 Replies View Related

Subtotal Based On Multiple Criteria

May 22, 2008

I need a formula that will take this information and automatically insert a row, a total, and then another row every time the Product (Column C) or the Account Number (column B) changes. The totals should be under Columns D and E only. But I don't want it to duplicate the results when both the product and the Account number change.

Beginning data: ...

View 6 Replies View Related

Sort By Subtotal, Make The Subtotal Stand Out

Feb 5, 2007

way to do this but i have a sheet that is into 5 - 6 thous rows, in one of the columns (names) i sort it by names and then order it by subtotal for certain values.

What i need to know, is there anyway i can take just the subtotal values out and put onto another spreadsheet without copying and pasting it all as there are lots of subtotals and this would help alot as the other info is not nec. just the subtotal'd info. either that or is there anyway i can highlight the subtotal'd row info in yellow/bold text anything like that that would make it stand out without having to do it manually?

View 12 Replies View Related

Subtotal Formula - To Show Up In The Subtotal Value Column

Oct 23, 2008

I’m trying to get my sheet so that at each change in month it creates a sum of the value but I want to sum to show up in the subtotal value column.....

View 10 Replies View Related

Subtotal Two Levels Based On Color Change Or Indent

Jun 25, 2008

I need advice regarding the best way to subtotal data that has been exported from SQL Reporting Services to Excel. Formulas are not exported with the worksheet and need to be re-entered. The data is contained in three levels, but second level is not always present (see attached). The Level 1 data has a "pale blue" background and desciptions start in column A. Level 2 data has a "Gray-25%" background and starts in Column B. Detail level data has no fill color and descriptions for it start in Column C. The detailed data should be subtotaled in the Level 2 line directly above it (if available). The Level 2 data should be subtotaled in the Level 1 row directly above it. If no Level 2 row exists beneath a Level 1 row then all of the detail rows below should be subtotaled in the Level 1 row.

I have looked at options for keying on the color or the column contents for triggering when to calculate the subtotals, but nothing that I have tried works. The attached sample file illustrates how the data looks after being exported from Excel. The number of detail rows may change at any time as new projects are added.

View 2 Replies View Related

Prorating Value Based On Start And End Date

Aug 26, 2013

I Have a sheet with the Value like ID, Start Date, End Date & Total Value..

I Want to devide the the Total Value in correspondent Months based on Start & End Date..

Last Month value will be End date-1

Sheet is like that:

A B C D
1 US-212 11-08-2011 14-11-2011 324424

View 2 Replies View Related

Week Number Based On Year Start 01/10

Jan 9, 2008

My finacial year starts on the 1st of October of each year and ends 30th of September each year.

My week is from Monday to Saturday - though for calculation ease: lets say that my week is from Monday to Sunday.

I need to calculate the week numbers of a date based on the above two criteria.

I understand that I need to ascertain the day of the start date first i.e: did 01/10/07 fall on Monday, Tuesday etc. - In fact it was Monday!

so for my year 07/08:Week 1 was 01/10/07 to 07/10/07Week 2 was 08/10/07 to 14/10/07ETCSo in the attached worksheet - what formula can I use to populate column D - by using the data in column E?

I.e. All I want to do, is input date into E and B, C, D will be calculated automatically. It would be great of excel could populate A - aswell ;-)

View 11 Replies View Related

Calculate Duration Based On Start & End Times

Jan 21, 2008

I have a spreadsheet with 4 columns - Start Date, Start Time, End Date and End Time. In the 5th column, I need to fill in the "Duration" which is calculated as follows :- Duration = (End Date,End Time) - (Start Date,Start Time)

View 2 Replies View Related

Subtotal Each Cell In A Column?

Feb 20, 2014

I have a sheet with about 3000 lines that looks something like this:

A...............B..................C
1234........$42.................Subtotal of all values in group "1234"
1839........$58.................Subtotal of all values in group "1839"
1837........$15.................etc
1234........$11.................etc
1592........$19.................etc

The numbers in column A refer to a specific "group" number - anything in this group I want to subtotal into column C.

I'm not sure how to do this though. I've looked at the =SUBTOTAL function, but I'm not sure exactly what to do to make what I'm trying to do work.

I wrote a For Each loop to go through each cell and add values, but that took like 4 hours to run - so.. that's not the way to go lol.

View 4 Replies View Related

Subtotal Right Cell For X Selection

Apr 16, 2007

I wanted to know if there was a way to subtotal where a X is selected the right value in the cell. I have attached a sheet to show an example

View 9 Replies View Related

Start/Stop Loop Based On Condition/Criteria

Aug 31, 2006

I have a piece of code that put a check in all checkbox in column B from row 5 to row 50 but in column C, I have data from row 5 to 38. I want the macro to stop at row 38 in column B. When the cell in column C is empty stop putting checks in column B. How can I make this macro Check all checkbox down column B and stop when column C is empty. How do I add a loop to stop when the cell in column C is empty?

Private Sub CommandButton1_Click()
Dim CB As Variant
For Each CB In ActiveSheet.CheckBoxes
CB.Value = False
Next
End Sub.......

View 3 Replies View Related

Calculate Holidays Remaing Based On Start Date

Nov 21, 2007

I want to create a formula that will do the following Each worker is entitled to 21 days holiday per year this will run from 8 Jan 08 to 7 Jan 09. But if a worker starts say 15 Apr 08 he would be entitled to less than 21 days. I would just like to be able to put his start date in a cell and then automatically generate how many days holiday he would be entitled to from 15 Apr to 7 Jan.

View 2 Replies View Related

Calculate Hours Worked Based On 2 Start/End Times

Feb 14, 2008

It's been several years sine I had to look at calculating amount of time worked.
Can you please look at this old spreadsheet of mine and verify that the formula is correct?

It appears to be ok to me, but I don't want any errors when it comes to paying my employees

Formula: ...

View 4 Replies View Related

Advanced Subtotal To Show The Value Of A Cell

Nov 30, 2007

The above formula works great and is something I am using in many of my spreadsheets. I have a question though, is it possible to use a simliar formula to show the value of the cell when filtered for example if you wanted to show a name?

--------------------------------------------------------------------------------

guessed that you filtered to display "yes" values....Evidently, no.

If the data with yes/no values is in B1:B100, with B1 as the col heading

This formula counts the occurrences of "yes" in the visible filtered range:
=SUMPRODUCT(SUBTOTAL(3,OFFSET(B2:B100,ROW(B2:B100) -ROW(B2),0,1))*(B2:B100="yes"))

Note: there are NO spaces in that formula

Is that something you can work with?

===========================================

View 9 Replies View Related

Adding Number To Subtotal In Same Cell?

Nov 2, 2012

I am trying to calculate the percentage of a number, have it subtotal, and then add to that subtotal another number all within the same cell like so:

20000 + 5% = 21000 + 4000 = 25000

View 3 Replies View Related

Subtotal For Cell To Automaticallly Do The Calculations

Jun 29, 2006

I went to data and did a subtotal for cell to automaticallly do the calculations. I have a question. How do I sort only by the subtotals? I sorted it and it only does it by ascending or descending order but the subtotal still got mixed up in there.

View 5 Replies View Related

Catching Start And End Date Based On User Defined Criteria?

Dec 27, 2013

i am trying to project future date by adding certain number of days, the problem is that i m trying to catch starting date(C2) based on user defined(B2) date criteria is

a. if B2 is normal working day then C2 is the next day i.e. B2 + 1 for example if user enters 1 jan 14(B2) then C2 should be 2 Jan 14.

b. if B2 is saturday then C2 should be monday i.e. C2 + 2 eg B2 = 4 jan 14 then C2 = 6 jan 14.

now the main problem part

c. if B2 is saturday and monday is holiday then C2 should be date corresponding to Tuesday or if tuesday is also a holiday then C2 should be Wednesday and like wise..

d. same for last day of leave is to be calculated similarly to starting date..

I tried lots of IF combinations but it's not working...

View 6 Replies View Related

Automating Monthly Budget Averages Based On Start And End Date

Jan 30, 2014

I am trying to create a document that takes our client PO amounts, tactics/spend line items, and dates from one sheet and averages them across the months that it is eligible, so we can know the total amount of money we can expect to go out from our clients each month.

For example:
Client1 Tactic1 StartDate EndDate TotalAmount
Client1 Tactic2 StartDate EndDate TotalAmount
Client1 Tactic3 StartDate EndDate TotalAmount
Client2 Tactic1 StartDate EndDate TotalAmount
Client2 Tactic2 StartDate EndDate TotalAmount

I have mostly figured this out in a really complicated way with many nested if statements, but there HAS to be a simpler way. There will be lots of hands in this document, so I would like to make it as simple and easy as possible.

View 4 Replies View Related

Split Equal Amount Across Months Based On Start And End Date?

Feb 6, 2014

I have contarct for amount $5000 with a start date of 1/1/2014 - 3/31/2014 (3 months). I would like to equally split my amount based on my number of months between 1/1/2014 and 3/31/2014 ie $1666.66/per month.

View 4 Replies View Related

Fill Number Series Based On Start / Stop Of 2 Cells

Jan 18, 2008

I have a excel sheet of data numbers which blongs a packet of inventory where i found number series like this:

Start Range End Range Qty
2101200 2101499 300

I have to draw this onto a series like 2101200 then 2101201 then 2010202 etc.
but some time these numbers are in qty 30000 or more. I have questions

1- If any macro colud fill series suppose if write number in A2 and qty in B2 so it reads the qty of b2 and fill the series in A. If i write 1 in A2 and write 50 in B2 so the series should be auto fill 1 to 50.

My Second question is opposit of my above question.

2- if i have different number series in column a and i want them to be as start number in column b and end number in column c and qty in column d based like mentioned below example.
Series [b]Start Range End Range Qty
1 1 1 1
3 3 3 1
5 5 7 3
6
7

View 8 Replies View Related

Excel 2007 :: Force Characters And Spaces In A Cell Over 80 To New Cell?

Jun 16, 2014

Using Excel 2007. I have a limit of 80 characters and spaces in a particular cell and I need to force those characters/spaces over 80 to the next cell. Is that possible?

View 11 Replies View Related

Add Spaces To A Cell

Nov 6, 2008

I have columns that are defined with these width's:
A - 9B - 1C - 12D - 12

I need a macro that would add spaces to the right of the cell if the cell does not have number of characters of the lenght of the column width.

For instance:
Cell A1 has 5 characters so it would need 4 spaces.
Cell A2 has 7 characters so it would need 2 spaces.
Cell B1 has 1 character so it would NOT need a space.
Cell B2 has 0 characters so it would need 1 space.

View 9 Replies View Related

Calculate With Subtotal Functions And Write Value In Cell

Aug 22, 2014

i have wrote the following code snipped:

Sheets(2).Activate
Sheets(2).Range("D8").Value = Application.WorksheetFunction.Subtotal(109, Sheet(4).Range("BJ3:BJ" & b)) + Application.WorksheetFunction.Subtotal(109, Sheet(3).Range("BJ4:BJ" & a))

The debugger said: That "Sheet" is not allowed in the subtotal-function. because i would like to calculate two subtotals in two sheets an write the sum in another sheet

View 1 Replies View Related

Selecting Entire Date Range To Be Lookup Based On Start And End Dates

Mar 6, 2013

I have an excel sheet where I would like a user to enter a start date and end date(say Feb 1, 2013 to Feb 28,2013). And these dates will be able to change to whatever month the user wishes to look up in a specific date range(column A has 365+ dates). This post is closely related to [URL]... but I cannot figure out how to get it to work from my case.

So working off the same worksheet, I have the beginning date in AC35 and the end date in AC36 in which the user enters. I would like the dates that fall in this entire month, including the beginning and ending dates to be referenced when looking for the specific day that contains a value I have in S35.

In other words, I have data in columns A through N. The dates are in column A and S35 is a value obtained from using Max(L185:L526) where L185:L185 is manually selected each time I want a different month. I don't want this to be a manual process of scrolling down the spreadsheet to get the next month.

View 12 Replies View Related

Identifying Spaces In A Cell?

May 14, 2014

I have some data that has names but is not consistant i.e

Smith, John
Smith,John

I want a formula that says, if there is a space after the comma do nothing, otherwise insert a space between.

I have figured out the second part so my formula will look like

=if(some logic to identify a space after the comma ,"",already figured out this bit)

View 5 Replies View Related







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