Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Percent Based Off Last Row Sum

This is what I have:

Columns("H:H").Select
LastRow = Cells(Rows.Count, "H").End(xlUp).Row
Cells(LastRow + 2, "H") = Application.Sum _
(Range(Cells(1, "H"), Cells(LastRow, "H")))

This sums the entire row in am empty cell two spaces below the last cell
with a value in it.

Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("e2:E" & LastRow).Formula = "=$d2/$d$49"

This formula is what I have. This figures the percent by dividing d2 into
D49, which happens to be the sum column in my current data, then auto fills
it into all subsequent cells of that column to the bottom of the cells with
values.

I want to take that resulting Sum of the first formula value and incorporate
it into a formula to calculate percentage that is not specific to tose cells.
BECAUSE, when I import new data from other places it may have more or less
rows. SO how can I figure the percentage using the resulting value of the
first formula???? THANKS!!!

If you need clarification, please ask :)


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Percent Based Off Last Row Sum

l1 = .Cells(.Rows.Count, "d").End(xlUp).Row
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("e2:E" & LastRow).Formula = "=$d2/$d$" & l1

perhaps.

--
Regards,
Tom Ogilvy


"bodhisatvaofboogie" wrote:

This is what I have:

Columns("H:H").Select
LastRow = Cells(Rows.Count, "H").End(xlUp).Row
Cells(LastRow + 2, "H") = Application.Sum _
(Range(Cells(1, "H"), Cells(LastRow, "H")))

This sums the entire row in am empty cell two spaces below the last cell
with a value in it.

Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("e2:E" & LastRow).Formula = "=$d2/$d$49"

This formula is what I have. This figures the percent by dividing d2 into
D49, which happens to be the sum column in my current data, then auto fills
it into all subsequent cells of that column to the bottom of the cells with
values.

I want to take that resulting Sum of the first formula value and incorporate
it into a formula to calculate percentage that is not specific to tose cells.
BECAUSE, when I import new data from other places it may have more or less
rows. SO how can I figure the percentage using the resulting value of the
first formula???? THANKS!!!

If you need clarification, please ask :)


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating a Percent based on Tiered criteria A Morrison Excel Discussion (Misc queries) 1 January 7th 09 05:18 PM
Sorting High to Low based on percent of total Harold Excel Discussion (Misc queries) 0 April 5th 06 05:19 PM
Formatting a number to look like a Percent without a percent sign David Iacoponi Excel Discussion (Misc queries) 2 September 15th 05 06:35 PM
calculate commission $ based on total sold and commission percent blondeindenver Excel Programming 1 July 6th 05 02:09 AM
how do you set auto shading of cell based on percent value in exc. d.rogers59 Excel Worksheet Functions 3 February 12th 05 08:25 AM


All times are GMT +1. The time now is 08:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"