Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default computations at odd locations

Hi

I have data available as follows:
Segment Value Percentage
A 2
B 7
C 5
Total
X 3
Y 2
Total
Q 4
W 6
E 3
R 8
Total

Unforrtunately, as you can see, the rows are unequal. I need to put
totals in the cell adjacent to where "Total" occurs. Also, based on
the totals percentage break-ups for each group needs to be computed.
Can someone suggest a way out?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default computations at odd locations

Utkarsh,

You could, of course, use a macro, but here is another way, without using macros.

I have assumed that your data is in columns A and B. starting in row 1 with headers, and row 2 with
data.

Select column B, then use Edit / Go to... Special Blanks, OK. Make a mental note of the row
number of the first blank cell.

Then type this formula (based on an old accounting trick...)

=SUM($B$2:B???)-2*SUMIF($A$2:A???,"Total",$B$2:B???)

replacing the ??? with the row number of the row ABOVE the first blank cell - for your example
table, witht he first blank in B5, you would use

=SUM($B$2:B4)-2*SUMIF($A$2:A4,"Total",$B$2:B4)

and then press Ctrl-Enter to enter that formula into every blank cell in column B.

In cell C2, enter this formula

=IF(A2<"Total",B2/VLOOKUP("Total",A2:B20,2,FALSE),"")

and copy down to match column B.


HTH,
Bernie
MS Excel MVP


"Utkarsh" wrote in message
...
Hi

I have data available as follows:
Segment Value Percentage
A 2
B 7
C 5
Total
X 3
Y 2
Total
Q 4
W 6
E 3
R 8
Total

Unforrtunately, as you can see, the rows are unequal. I need to put
totals in the cell adjacent to where "Total" occurs. Also, based on
the totals percentage break-ups for each group needs to be computed.
Can someone suggest a way out?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 135
Default computations at odd locations

Utkarsh -

Assuming your data is in columns A-C with headers in row 1 and data starting
in row 2, you can get what you want by adding two columns.
Do not put anything in the normal header row D1.
In D2, enter
=IF(A1="Total",B2,B2+D1)
In E2, enter
=IF(A2="Total",B2,E3)
In C2, enter
=IF(A2="Total",1,B2/E2)
Drag these down the columns. column C will have the correct percents.
This all depends on the word Total being in column A at the end of each block.

--
Daryl S


"Utkarsh" wrote:

Hi

I have data available as follows:
Segment Value Percentage
A 2
B 7
C 5
Total
X 3
Y 2
Total
Q 4
W 6
E 3
R 8
Total

Unforrtunately, as you can see, the rows are unequal. I need to put
totals in the cell adjacent to where "Total" occurs. Also, based on
the totals percentage break-ups for each group needs to be computed.
Can someone suggest a way out?

.

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
DATE COMPUTATIONS sonarmark Excel Worksheet Functions 2 April 9th 08 03:29 PM
Date formats and computations -- Help sonarmark Excel Worksheet Functions 2 April 9th 08 08:10 AM
Freeze screen during computations fmistry Excel Discussion (Misc queries) 1 February 26th 07 10:35 PM
Printing from different locations Rajula Excel Discussion (Misc queries) 1 May 31st 06 10:12 AM
Computations involving text cells are not working?? Text Cell Computations Excel Worksheet Functions 2 January 31st 05 06:48 PM


All times are GMT +1. The time now is 12:36 AM.

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

About Us

"It's about Microsoft Excel"