How to optimize IF(return value<0, if true show return value, if false show 0) ?

kancolle

New Member
Joined
Oct 14, 2021
Messages
6
Office Version
  1. 2007
Platform
  1. Windows
I trying to have a cell with formula to show its returned value if <0, but show 0 if >=0. Can we do that in Excel?

Column B is list of different product names in mixed order.
Column C is profit for each row in B where C could be positive or negative numbers.
On the side, I'm trying to summarize, eg. cell E1 to show if a selected product is making loss or not.

First, I pieced together this to find out net profit for a selected product, eg. banana.

cell E1 =SUMIFS(C1:C100,B1:B100,"banana")

Then, I try to combine with IF to have cell E1 reference itself and display value if formula's returned value <0, and display 0 if returned value >=0.

I want to say concisely cell E1 =IF(SUMIFS(C1:C100,B1:B100,"banana")<0,show return value,0)

But Excel is making me re-write that whole segment =IF(SUMIFS(C1:C100,B1:B100,"banana")<0,SUMIFS(C1:C100,B1:B100,"banana"),0)

Is there anyway to optimize it? Thank you.

ps.

By the way, something off-topic, where I used SUMIFS, even though only one condition, is there any benefit to use the older SUMIF? I thought SUMIFS's string format looks more speech intuitive to me and allows for future additional conditions. SUMIFS can have one or more conditions, so why is SUMIF still around and not removed?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,215,717
Messages
6,126,422
Members
449,314
Latest member
MrSabo83

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top