Learn More
Community
Question
Applies to Office | Office 2010 | Microsoft Office Excel | Office for Windows 7
162 views
understanding formulas
ND
why do i need the before the Mid function in the following formula =SUMPRODUCTMIDA1,ROWINDIRECT"1:" & LENA1,1 , its a
formula that sums up the digits of a number in cell A1?
Reply
Answer
Bernie Deitrick replied on September 12, 2013
The MID is used to parse out the characters one at a time but returns them as string values. The second converts them to numbers but
then they are negative, so the first makes them positive.
This would return 0 because of the strings
=SUMPRODUCTMIDA1,ROWINDIRECT"1:" & LENA1,1
This would return the negative of the sum of the digits
=SUMPRODUCTMIDA1,ROWINDIRECT"1:" & LENA1,1
This will also return the correct sum of the digits
=SUMPRODUCTMIDA1,ROWINDIRECT"1:" & LENA1,1
This will also return the sum of the digits but apparently, multiplying is too processor intensive for some Excel fanatics' tastes. Multiplying is
my preferred approach for when I need to convert booleans or strings to numbers
=SUMPRODUCT1*MIDA1,ROWINDIRECT"1:" & LENA1,1
HTH,
Bernie
Reply
Reply
Hi,
That is to convert numbers stored as text back to numbers. You can also write the formula as follows:
Regards,
Ashish Mathur
www.ashishmathur.com
http://twitter.com/excelashish
Reply
I am using MS Office 2013 excel and when pressing the "F9" andwhen the below text is highlighted
I get a message "This formula is too long. Formulas should not be longer than 8192 characters" and the data I am using is one word with a
number "mon1" or "Month1"
Data Set in excel in K61: Mon1 or month1
=ROWINDIRECT"1:"&LENK61
Any ideas,it seems to be something with LEN Function. I am
using this for business plan and your insight/help is appreciated.
Cheers
Damon
Reply
HTH,
Bernie
Reply
TO
MVP
displayed.
If K61 literally contains the string: Mon1 or month1
then the returned value from doing F9 would be
I get: {1;2;3;4;5;6;7;8;9;10;11;12;13;14;15}
Regards,
Tom Ogilvy
Tom Ogilvy
Reply
Reply
If I have month1 in cell K61, then put this formula in another cell
=ROWINDIRECT"1:"&LENK61
TO
Reply
Regards,
Tom Ogilvy
Tom Ogilvy
Reply
M1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 6 6
o
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
n
t
h
o
r
B
l
a
n
k
1
Data name J93
FreTICIWS
Iknow this formula is not that elegant or optimized. I will review it further soon and repost, if Ifigure anybetterformula.However, I noticed at
Microsoft no one seems to be aware of the this issue or perhaps I need to be set on the right path. I am looking for transparency. Anyone
wanting to weight in this is welcome to.
I also will post another formulawith an array constant dealing with same bit of code mentioned above on the original posting on DamonWelch
replied on .
Highest Regards,
Damon
Reply
Related Content
Related Content
Show more content like this
English
Microsoft Community Code of Conduct
Community Participation Center
Trademarks
Privacy & Cookies
Terms of Use
2016 Microsoft