• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Excel question

acole1

Golden Member
I have a situation where I need to sum the values in column B where the values in column A match... but only when column C has a "Y" in it, and display them in column D.

Example:
|A|25|N|
|B|80|N|
|C|15|Y|15|
|A|30|N|
|A|10|Y|65|
|B|50|N|
|D|45|N|


A function or combination of functions would be best, but a VB script would work as well. Note that I have never used VB in excel before, so I'm rather green in that respect.

Please let me know if the example is not clear and I will try and explain myself better.
 
nevermind, I figured out what you wanted. Anyway, here's the equation, just put it in D1 then click and drag it to copy it down:

=IF(UPPER(C1)="Y",SUMIF(A:A,A1,B:B))

If you want the cell to be blank instead of say FALSE if C is not Y, then add ,"" before the last parenthesis.
 
Originally posted by: armstrda
nevermind, I figured out what you wanted. Anyway, here's the equation, just put it in D1 then click and drag it to copy it down:

=IF(UPPER(C1)="Y",SUMIF(A:A,A1,B:B))

If you want the cell to be blank instead of say FALSE if C is not Y, then add ,"" before the last parenthesis.

That worked great, thanks! I had been racking by brain and had no idea how to do it. 😀
 
Just to note that if you are using Excel 2007 there is a new function called SumIFs(). It allows for multiple conditions, while SumIf() is limited to just one (depending on how cleverly you craft that condition, you could squeeze more than one out of it, though).
 
Ahh, I didn't have excel 2007 on the system I worked that out on this morning, but I see that on this system now. Thanks for the heads up 🙂
 
Back
Top