Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
0-0 Wai Wai ^-^
 
Posts: n/a
Default A difficult conditonal calculation

A difficult conditonal calculation

Hi.
It's the look of my Excel file:

Item 1----Amount
Category---Details: ...
Item 2----Amount
Category---Details: ...
Item 3----Amount
Category---Details: ...
Item 4----Amount
Category---Details: ...

As you see:
- A1 is the item's name; A2 is the price/amount/cost/value of the item
- B1 is the category the item belongs to; B2 is the description of the item.

Now I would like to do some math which are the following:
1) If the category type is income, add all of them
2) If the category type is one-off expense, add all of them & put a minus sign
in front of the value
3) If the category type is daily expense, add all of them & times 30, & put a
minus sign in front of the value
4) If the category type is Asset A, put each amount of the item in this
calculation: (Amount-1000)*3/5
and so on

How can I achieve this?
Thanks a lot.

--
Additional information:
- I'm using Office XP
- I'm using Windows XP



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
 
Posts: n/a
Default A difficult conditonal calculation

On Sun, 27 Nov 2005 19:57:57 -0000, "0-0 Wai Wai ^-^" wrote:

A difficult conditonal calculation

Hi.
It's the look of my Excel file:

Item 1----Amount
Category---Details: ...
Item 2----Amount
Category---Details: ...
Item 3----Amount
Category---Details: ...
Item 4----Amount
Category---Details: ...

As you see:
- A1 is the item's name; A2 is the price/amount/cost/value of the item
- B1 is the category the item belongs to; B2 is the description of the item.

Now I would like to do some math which are the following:
1) If the category type is income, add all of them
2) If the category type is one-off expense, add all of them & put a minus sign
in front of the value
3) If the category type is daily expense, add all of them & times 30, & put a
minus sign in front of the value
4) If the category type is Asset A, put each amount of the item in this
calculation: (Amount-1000)*3/5
and so on

How can I achieve this?
Thanks a lot.



It would probably be simpler if all of your data were in the same row.

However, with your presently described layout, assuming your table is in

A1:Bn

then the formula to sum an individual category is:

=SUMIF($A$2:$A$n,CategoryType,$B$1:$B$n-1)

or, if you have 1,000 rows of data:

=SUMIF($A$2:$A$1000,CategoryType,$B$1:$B$999)

From there it is easy:

Income: =SUMIF($A$2:$A$n,"Income",$B$1:$B$n-1)

One-Off: =-SUMIF($A$2:$A$n,"One-Off",$B$1:$B$n-1)

Daily: =-30*SUMIF($A$2:$A$n,"Daily",$B$1:$B$n-1)

Asset A:

=(SUMIF($A$2:$A$1000,"Asset A",$B$1:$B$999) -
1000*COUNTIF($A$2:$A$1000,"Asset A"))*3/5



--ron
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
Simple Calculation - but Difficult! [email protected] Excel Discussion (Misc queries) 1 August 18th 05 10:16 AM
difficult calculation joolz46 Excel Worksheet Functions 2 July 11th 05 04:25 PM
Calculation Setting in Excel Stuart Bisset Excel Discussion (Misc queries) 0 June 17th 05 09:54 AM
How do I use a rounded calculation result in another calculation? vnsrod2000 Excel Worksheet Functions 1 January 26th 05 10:11 PM
Difficult (for me) formula/UDF calculation Mike Echo Excel Worksheet Functions 4 December 25th 04 09:09 AM


All times are GMT +1. The time now is 05:34 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"