Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / November 2005

Tip: Looking for answers? Try searching our database.

A difficult conditonal calculation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
0-0 Wai Wai ^-^ - 27 Nov 2005 19:57 GMT
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.

Signature

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

Ron Rosenfeld - 28 Nov 2005 03:50 GMT
>A difficult conditonal calculation
>
[quoted text clipped - 26 lines]
>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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.