We’d like to remind Forumites to please avoid political debate on the Forum.
This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
Excel Calculations
marka87uk
Posts: 441 Forumite
in Techie Stuff
Refering to the following image (although I have OOo at home, I would like to solve this for Excel (for work)).

Basically, I need to populate the table on the right with information from the left.
This may be a bit confusing but I'll try my best to explain...
1. For instance, in F2, the value should be the number of the amounts which Fred had for reason 1. It would be 1 because Fred only has one reason 1. In F4 the value should be 2 because Peter has two reason 1's.
2. Secondly I need to calculate the total cost for that reason, F6 would read £255 (100+25+130), as that is the total cost for reason 1. G6 would read £70 (20+50).
Is this possible?

Basically, I need to populate the table on the right with information from the left.
This may be a bit confusing but I'll try my best to explain...
1. For instance, in F2, the value should be the number of the amounts which Fred had for reason 1. It would be 1 because Fred only has one reason 1. In F4 the value should be 2 because Peter has two reason 1's.
2. Secondly I need to calculate the total cost for that reason, F6 would read £255 (100+25+130), as that is the total cost for reason 1. G6 would read £70 (20+50).
Is this possible?
0
Comments
-
in case 1 - do a count if statement
for case 2 - do a simif statement
use the excel wizards to help you out - it should be quite straight forwards (i also think a pivottable might do this quite nicely)
let me know if u need any further help0 -
Use SUMPRODUCT as follows:
1. In F2: =SUMPRODUCT(($B$3:$B$9="Fred")*($C$3:$C$9=1))
2. In F6: =SUMPRODUCT($A$3:$A$9*($C$3:$C$9=1))
I've used absolute references for the cell ranges (e.g. $B$3:$B$9) because your data has a fixed range and this makes it easier to drag the formula down or across. You can change this easily by clicking the mouse inside a range on the formula bar and pressing F4 to cycle through relative, mixed and absolute references.0 -
Thanks I shall try it 2moro.
0 -
This is how I'd do it -
In cell F2 which can be dragged down and across to complete the table
=SUMPRODUCT(--($B$3:$B$9=$E2),--($C$3:$C$9=F$1))
and for the totals ( which doesn't need sumproduct as there is only one condition, a sumif would suffice)
=SUMIF($C$3:$C$9,F$1,$A$3:$A$9).
( chippys should work fine also, although would recommend you don't have the fred's etc hard coded in the formulas)0
This discussion has been closed.
Confirm your email address to Create Threads and Reply
Categories
- All Categories
- 352.5K Banking & Borrowing
- 253.7K Reduce Debt & Boost Income
- 454.5K Spending & Discounts
- 245.5K Work, Benefits & Business
- 601.5K Mortgages, Homes & Bills
- 177.6K Life & Family
- 259.5K Travel & Transport
- 1.5M Hobbies & Leisure
- 16K Discuss & Feedback
- 37.7K Read-Only Boards