Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-23-2019, 08:35 AM
pokeyarw pokeyarw is offline Extract numbers from parentheses and add them up Mac OS X Extract numbers from parentheses and add them up Office 2011 for Mac
Novice
Extract numbers from parentheses and add them up
 
Join Date: Apr 2019
Posts: 5
pokeyarw is on a distinguished road
Default Extract numbers from parentheses and add them up

Greetings,
I’d like to extract some parenthesized numbers from a column of cells. E.g.
6031, Cash(40)
Cash(44)
2722

Cash


5887
1985
1670
1246, 1245
1398
I can extract the amount of cash with

=VALUE(IFERROR(MID(Q5,SEARCH("(",Q5,1)+1,SEARCH(") ",Q5,1)-SEARCH("(",Q5,1)-1),0))


which works just fine, but I don’t really want the individual values, I want the sum. If I copy fill this down it produces all the right numbers. There’s probably a more elegant way to do this, but this works.
But I really want the total and it seems like a sumproduct or just a sum should give me the sum but it gives me zero, e.g.,

=SUMPRODUCT((IFERROR(VALUE(MID(Q5:Q33,SEARCH("(",Q 5:Q33,1)+1,SEARCH(")",Q5:Q33,1)-SEARCH("(",Q5:Q33,1)-1)),0)))

I’m obviously working in column Q and the array I want to sum is Q5:Q33.
What am I missing?

For reasons I don't understand, the published version of this post shows a space between the Q and the 5 in the first SEARCH looking for the "(". It's not there in my usage.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract numbers from parentheses and add them up Allignment of numbers with parentheses RussBell Mail Merge 2 10-28-2016 05:51 AM
Extract numbers from parentheses and add them up Is there a quick way to remove the dashes and parentheses from phone numbers? Stacy Excel 2 09-12-2014 07:03 AM
How to extract only numbers from a STRING? Learner7 Excel 3 07-02-2013 06:25 AM
Extract Numbers from Zip Code Karen615 Excel 3 09-21-2011 06:54 AM
Extract numbers from a text string aleale97 Excel 4 02-10-2011 10:33 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:19 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft