Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Tony
 
Posts: n/a
Default Category subtotalling

I am trying to minimize the amount of space this spreadsheet takes up. I
have Three colums. The first column is the category type (39 or 41). The
second column is the estimated cost before construction. The third column is
the actual cost. What I want to do is average the difference between
estimated and acutal cost for each category. There is no pattern to the
category selection. It depends on the job. I was trying to write an if,
then, statement but it has been awhile and I am not sure if you can do it
anyway. It was something like this...

average(IF(column1=39,(column2-column3)/column2),else if(column1=41,skip to
next row))

If you can make sense of all this let me know.
  #2   Report Post  
Jim Rech
 
Posts: n/a
Default

Say the data runs from A1 to C12. This formula may do what you want (for
39). It is an "array formula". That means it has to be entered via
Ctrl-Shift-Enter rather than just Enter.

=SUM((C1:C12-B1:B12)*(A1:A12=39))/COUNTIF(A1:A12,39)

--
Jim
"Tony" wrote in message
...
|I am trying to minimize the amount of space this spreadsheet takes up. I
| have Three colums. The first column is the category type (39 or 41). The
| second column is the estimated cost before construction. The third column
is
| the actual cost. What I want to do is average the difference between
| estimated and acutal cost for each category. There is no pattern to the
| category selection. It depends on the job. I was trying to write an if,
| then, statement but it has been awhile and I am not sure if you can do it
| anyway. It was something like this...
|
| average(IF(column1=39,(column2-column3)/column2),else if(column1=41,skip
to
| next row))
|
| If you can make sense of all this let me know.


  #3   Report Post  
Tony
 
Posts: n/a
Default

I guess not. I don't understand the Ctrl-Shift-Enter part I think. If I put
in this equation I get "#value". If I take out the column references so that
it only uses the one row it works but that does not do it for me.

"Jim Rech" wrote:

Say the data runs from A1 to C12. This formula may do what you want (for
39). It is an "array formula". That means it has to be entered via
Ctrl-Shift-Enter rather than just Enter.

=SUM((C1:C12-B1:B12)*(A1:A12=39))/COUNTIF(A1:A12,39)

--
Jim
"Tony" wrote in message
...
|I am trying to minimize the amount of space this spreadsheet takes up. I
| have Three colums. The first column is the category type (39 or 41). The
| second column is the estimated cost before construction. The third column
is
| the actual cost. What I want to do is average the difference between
| estimated and acutal cost for each category. There is no pattern to the
| category selection. It depends on the job. I was trying to write an if,
| then, statement but it has been awhile and I am not sure if you can do it
| anyway. It was something like this...
|
| average(IF(column1=39,(column2-column3)/column2),else if(column1=41,skip
to
| next row))
|
| If you can make sense of all this let me know.



  #4   Report Post  
Jim Rech
 
Posts: n/a
Default

I don't understand the Ctrl-Shift-Enter part I think

Ok. Copy my formula. Select a cell for it and press F2. Then press Ctrl-v
to paste it. But don't press Enter. Instead hold down Ctrl and Shift and
then press Enter.

If you don't like array formulas then you have to do this using multiple
cells, probably as you are now.

--
Jim
"Tony" wrote in message
...
|I guess not. I don't understand the Ctrl-Shift-Enter part I think. If I
put
| in this equation I get "#value". If I take out the column references so
that
| it only uses the one row it works but that does not do it for me.
|
| "Jim Rech" wrote:
|
| Say the data runs from A1 to C12. This formula may do what you want
(for
| 39). It is an "array formula". That means it has to be entered via
| Ctrl-Shift-Enter rather than just Enter.
|
| =SUM((C1:C12-B1:B12)*(A1:A12=39))/COUNTIF(A1:A12,39)
|
| --
| Jim
| "Tony" wrote in message
| ...
| |I am trying to minimize the amount of space this spreadsheet takes up.
I
| | have Three colums. The first column is the category type (39 or 41).
The
| | second column is the estimated cost before construction. The third
column
| is
| | the actual cost. What I want to do is average the difference between
| | estimated and acutal cost for each category. There is no pattern to
the
| | category selection. It depends on the job. I was trying to write an
if,
| | then, statement but it has been awhile and I am not sure if you can do
it
| | anyway. It was something like this...
| |
| | average(IF(column1=39,(column2-column3)/column2),else
if(column1=41,skip
| to
| | next row))
| |
| | If you can make sense of all this let me know.
|
|
|


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
How do I change the category axis number formatting in a Pivot Ch. Cultcab Charts and Charting in Excel 0 April 19th 05 12:26 AM
Help needed with cell category, ie Number/Text etc Martc Excel Discussion (Misc queries) 6 April 18th 05 01:20 PM
Alignment of Multiple-Level Category Labels Not Possible? MCP Charts and Charting in Excel 1 March 26th 05 07:01 AM
Rank within Category Henrik Excel Worksheet Functions 0 January 28th 05 07:03 PM
Rank() based on category Henrik Excel Worksheet Functions 1 January 12th 05 08:40 PM


All times are GMT +1. The time now is 04:51 AM.

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"