Volume Unit Cost Before
44 14.11 n/a
9 10.46 8.58
37 9.61 7.88
20 8.26 6.77
78 7.36 6.04
0 3.65 n/a
Can someone show me how to multiple column a*b if column c is "n/a". And column a*c if it has a number, with suming them at the end?
Thanks
Volume Unit Cost Before
44 14.11 n/a
9 10.46 8.58
37 9.61 7.88
20 8.26 6.77
78 7.36 6.04
0 3.65 n/a
Can someone show me how to multiple column a*b if column c is "n/a". And column a*c if it has a number, with suming them at the end?
Thanks
Try:
=SUMPRODUCT(--ISNUMBER(C2:C7),A2:A7,C2:C7)+SUMPRODUCT(--(C2:C7="n/a"),A2:A7,B2:B7)
Where there is a will there are many ways.
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Or, if preferred
=SUM(A2:A7*IF(ISNUMBER(C2:C7),C2:C7,B2:B7))
confirmed with CTRL + SHIFT + ENTER
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Not working for me. What does the "--" do?
They coerce arrays of TRUE/FALSE to 1/0, respectively so Sumproduct can do the math...
How is it not working?
Are you sure you have the ranges correct?
Are the numbers in column C actually formatted as numbers?
Try selecting column C and go to Data|Text to Columns and click Finish.
Here it is working with your data.
I am confirming with "shift+ctrl+enter" and it still pulls an error. I have really never play with arrays before so I am kinda thinking I am messing it up.
See my last 2 posts or attach a spreadsheet showing issue.
Got it. Thanks for the help!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks