A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How can I extract the second half of addition ?



 
 
Thread Tools Display Modes
  #21  
Old September 28th, 2008, 08:20 PM posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
external usenet poster
 
Posts: 3,719
Default How can I extract the second half of addition ?

On Sun, 28 Sep 2008 20:41:16 +0200, "Gilbert DE CEULAER"
wrote:

Thanks, Ron, I do not understand the code... but it works.
Gilbert


I'm glad it works. Thanks for the feedback.

The part of the code that you won't find in the HELP section has to do with the
regular expression engine. There is information he

http://support.microsoft.com/default...02&Product=vbb
http://msdn2.microsoft.com/en-us/library/6wzad2b2.aspx
http://www.regular-expressions.info/reference.html

The re.Pattern that I am using, "\d(\+\d+$)"

matches

any digit
followed by a '+'
followed by any number of digits
followed by the end of line.

So it is looking for a pattern which matches anything like:

6+2
or
6+234

etc.

If that pattern matches, then it returns everything except the leading digit.
--ron
  #22  
Old September 28th, 2008, 10:06 PM posted to microsoft.public.excel.worksheet.functions
Bernd P
external usenet poster
 
Posts: 613
Default How can I extract the second half of addition ?

Hello,

Ron's VBA solution might seem preferrable but there is a non-VBA
solution:
Define the name SecSumPar, for example, which refers to:
=MID(GET.CELL(6,INDIRECT("RC[-1]",FALSE)),1+LOOKUP(2,1/
("+"=MID(GET.CELL(6,INDIRECT("RC[-1]",FALSE)),ROW(INDIRECT("1:"&LEN(GET.CELL(6,INDIREC T("RC[-1]",FALSE))))),
1)),ROW(INDIRECT("1:"&LEN(GET.CELL(6,INDIRECT("RC[-1]",FALSE)))))),
999)

Then insert into the next cell right to your cell with =3+4:
=SecSumPar
and you will get
4

Regards,
Bernd
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.