• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Sum up the postive numbers and negative numbers from a cell|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Sum up the postive numbers and negative numbers from a cell|General Excel Questions & Answers|Excel Forum|My Online Training Hub

Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…Sum up the postive numbers and nega…
sp_PrintTopic sp_TopicIcon
Sum up the postive numbers and negative numbers from a cell
Avatar
julian
Member
Members
Level 0
Forum Posts: 79
Member Since:
December 12, 2016
sp_UserOfflineSmall Offline
1
December 10, 2022 - 9:20 am
sp_Permalink sp_Print sp_EditHistory

I have a formula mathematically operatiing on many numbers going to a single cell like this A1 =-200+210-325-87+412-60+88 with negatives denote cash outs and positives denote cash ins then return the profit or loss. In order to calculate the ROI(Return on Inventment) I need another cell say it B1 =A1/sum(negatives of A1). Is there any array formula or something else to get the sum of all the negatives in A1?

sp_AnswersTopicSeeAnswer See Answer
Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4354
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
2
December 10, 2022 - 11:25 am
sp_Permalink sp_Print

Hi Julian,

If you have Microsoft 365 you can use the new dynamic array formulas. e.g. where your sum is in cell A2 you can use this formula:

=-SUM(VALUE(FILTER(TEXTSPLIT(FORMULATEXT(A2),,{"-";"+"}),DROP(TEXTSPLIT(FORMULATEXT(A2),,TEXTSPLIT(FORMULATEXT(A2),,{"-";"+"})),-1)="-")))

 

In the file attached I have broken down the steps for the formula above so you can see how it calculates. 

The individual functions are explained here.

If you don't have Microsoft 365, then I would avoid stuffing cells with hard keyed sums like this as I'm not sure there's a way to do this before dynamic array formulas. If the values are in their own cells, then you can easily sum them with SUMIF.

Mynda

sp_AnswersTopicAnswer
Answers Post
Avatar
julian
Member
Members
Level 0
Forum Posts: 79
Member Since:
December 12, 2016
sp_UserOfflineSmall Offline
3
December 11, 2022 - 6:28 am
sp_Permalink sp_Print sp_EditHistory

Hi Mynda,

I just know it. Nothing can beat you!

Be honest, I do get some solutions so far but yours is the best. The most amazing portion is that you combined the DROP and TEXTSPLIT functions to get the delimiters "+" & "-" . By the way, I found without DROP function, TEXTSPLIT(FORMULATEXT(A2),,B2#) may return the signs as well. Anyway, I love your marvelous solutions so much, I love you too. 

p.s. It’s my honor to share your unparalleled solution to Microsoft Community. Please click the following link.

https://answers.microsoft.com/.....ddb7e7707d

Julian 

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4354
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
4
December 11, 2022 - 1:20 pm
sp_Permalink sp_Print

Glad you liked it, Julian and thanks for sharing my solution in the other forum.

For future reference, please note that you must always make it clear that you have cross posted in another forum. It is courteous to those who give up their time volunteering to help you.

Mynda

Avatar
julian
Member
Members
Level 0
Forum Posts: 79
Member Since:
December 12, 2016
sp_UserOfflineSmall Offline
5
December 11, 2022 - 3:38 pm
sp_Permalink sp_Print

Hi Mynda,

Sorry, I can't get your point. I really have no idea what I've done wrong. I surely respect and appreciate all the instructors' efforts having replied me whether my questions were solved or not. Therefore, could you please tell me more clearly which area I must pay attention to so that I won't make the similar mistakes next time.

Best regards,

Julian

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4354
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
6
December 12, 2022 - 9:33 am
sp_Permalink sp_Print

Hi Julian,

When you first make the post, in our forum or any other forum, when you've also posted the same question elsewhere, you must state that you have also posted your question in another forum and share a link to that forum post accordingly. This is to allow those who are helping to check if your question has already been answered in the other forum, so they can avoid wasting time duplicating work that's not required.

Hope that clarifies, but please let me know if you have further questions.

Mynda

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 170
Currently Online: Norilina Harvel
Guest(s) 38
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1431
Anders Sehlstedt: 848
Velouria: 574
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 213
A.Maurizio: 202
Aye Mu: 201
Jessica Stewart: 185
Newest Members:
David Collins
Andras Marsi
Orimoloye Funsho
YUSUF IMAM KAGARA
PRADEEP PRADHAN
Vicky Otosnika
Abhishek Singh
Kevin Sojourner
Kara Weiss
And Woox
Forum Stats:
Groups: 3
Forums: 24
Topics: 6047
Posts: 26543

 

Member Stats:
Guest Posters: 49
Members: 31497
Moderators: 2
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Riny van Eekelen
© Simple:Press —sp_Information
  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
 
  • About My Online Training Hub
  • Contact
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Copyright © 2023 · My Online Training Hub · All Rights Reserved

Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.

Download A Free Copy of 100 Excel Tips & Tricks

excel tips and tricks ebook

We respect your privacy. We won’t spam you.

x