Negative values sum

andresf

New Member
Joined
May 13, 2012
Messages
22
Hi,

Can someone please help with this

Oct YTD = Jan+Feb+Mar+Apr+...+Oct. How can I get the sum of only the negative values?

CodeJan-23Feb-23Mar-23Apr-23May-23Jun-23Jul-23Aug-23Sep-23Oct-23Nov-23Dec-23Oct YTD
AAA100200-100-200500-70010001200-600-500


Next month, it will be the same logic but including november's value. How can I update the range automatically (Jan+Feb+Mar+...+Nov)?
CodeJan-23Feb-23Mar-23Apr-23May-23Jun-23Jul-23Aug-23Sep-23Oct-23Nov-23Dec-23Nov YTD
AAA100200-100-200500-70010001200-600-500-1000

Thanks in advance,

Edu
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
if you are using excel 2010 (maybe 2007) or higher (PLEASE update your profile what version you use).
Assuming AAA is in cell A2.

Excel Formula:
=SUM(if(B2:M2<0,B2:M2,0))

enter with CTRL-SHFT-ENTR.

Mr excel questions 68.xlsm
ABCDEFGHIJKLMNO
1CODEJan-23Feb-23Mar-23Apr-23May-23Jun-23Jul-23Aug-23Sep-23Oct-23Nov-23Dec-23YTD
2AAA100200-100-200500-70010001200-600-500-2100
3100200-100-200500-70010001200-600-500-1000-3100
andresf
Cell Formulas
RangeFormula
C1:M1C1=EDATE(B1,1)
O2:O3O2=SUM(IF(B2:M2<0,B2:M2,0))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Last edited:
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

How about
Excel Formula:
=SUMIFS(B2:M2,B2:M2,"<0")
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

How about
Excel Formula:
=SUMIFS(B2:M2,B2:M2,"<0")
@Fluff , one day I will remember that TRUE FALSE results can be summed on their own! I I did not word that correctly, please ignore.
 
Upvote 0

Forum statistics

Threads
1,215,080
Messages
6,123,013
Members
449,093
Latest member
ikke

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