Anda di halaman 1dari 12

By using this site you agree to the use of cookies for analytics, personalized content and ads.

Learn More

Community

Question
Applies to Office | Office 2010 | Microsoft Office Excel | Office for Windows 7
162 views

understanding formulas
ND

Netser David asked on September 12, 2013

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?

1 person had this question


Me Too

Reply

Answer
Bernie Deitrick replied on September 12, 2013

MCC: Content Creator

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

2 people found this helpful


Helpful

Reply

All replies (10)


ND

Netser David replied on September 12, 2013

In reply to Bernie Deitrick's post on September 12, 2013


many thx, david

Be the first person to mark this helpful


Helpful

Reply

Ashish Mathur replied on September 13, 2013


Wiki Author
Completed Training
MCC: Content Creator

Hi,

That is to convert numbers stored as text back to numbers. You can also write the formula as follows:

=SUMPRODUCT1*MIDA1,ROWINDIRECT"1:" & LENA1,1

Hope this helps.

Regards,
Ashish Mathur
www.ashishmathur.com
http://twitter.com/excelashish

Be the first person to mark this helpful


Helpful

Reply

DamonWelch replied on May 22, 2015

In reply to Bernie Deitrick's post on September 12, 2013


Hi All
I picked this goody from Mr. Mike Girvin you tube Excel
Magic Trick 489: Extract Only Numbers From Text String Array Formula
and said he got this tidbit from Ron Coderre MVPby posting question on Mr Excel.

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

Be the first person to mark this helpful


Helpful

Reply

Bernie Deitrick replied on May 22, 2015

MCC: Content Creator

In reply to DamonWelch's post on May 22, 2015


Have you used the correct, full array formula needed? Enter with CtrlShiftEnter:
=SUMMIDK61,LARGEISNUMBERMIDK61,ROW$1:$25,1*ROW$1:$25,ROW$A$1:INDEX$A:$A,COUNT
MIDK61,ROW$1:$25,1,1*10^ROWINDEX$1:$25,COUNTMIDK61,ROWINDEX$1:$25,1,1:
INDEX$1:$25,LENK61,1,1,1:INDEX$1:$25,1,11

HTH,
Bernie

Be the first person to mark this helpful


Helpful

Reply

Tom Ogilvy replied on May 22, 2015

TO

MVP

In reply to DamonWelch's post on May 22, 2015


Damon,
If I have month1 in cell K61, then put this formula in another cell
=ROWINDIRECT"1:"&LENK61
then go to the formula bar, highlight it an hit F9 I get
{1;2;3;4;5;6}

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

Be the first person to mark this helpful


Helpful

Reply

DamonWelch replied on May 22, 2015

In reply to Bernie Deitrick's post on May 22, 2015


I believe the suggestion you gave is a good idea but the idea that the CtrlShiftEnter is part of the problem might stretchingthe issue too
much I say veryrespectfullyor the formula you posted not close to the same issue.
Tom Ogilvybellows illustrates this is not necessary. My issue seems to allude us all still not really knowing what's happening.

Be the first person to mark this helpful

Be the first person to mark this helpful


Helpful

Reply

DamonWelch replied on May 22, 2015

In reply to Tom Ogilvy's post on May 22, 2015


Tom

If I have month1 in cell K61, then put this formula in another cell

=ROWINDIRECT"1:"&LENK61

then go to the formula bar, highlight it an hit F9 I get


"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"
This is clearly not too long.
Are you using MS Office 2013 E4 ? or another version of excel.
Highest regards,
Damon

Be the first person to mark this helpful

Be the first person to mark this helpful


Helpful

TO

Reply

Tom Ogilvy replied on May 22, 2015


MVP

In reply to DamonWelch's post on May 22, 2015


Originally tested in Excel 2007. Now tested in Excel 2013. Same results as expected.
Only thing I can think of is that you have many many space or other invisible characters appendedto the Month1 entry in the cell. You can just
do =LenK61 to check the length of the text stringin cell K61.

Regards,
Tom Ogilvy

Tom Ogilvy

Be the first person to mark this helpful


Helpful

Reply

DamonWelch replied on May 28, 2015

In reply to Tom Ogilvy's post on May 22, 2015


Hello All,
I ended up finding out that the error is common in MS Office 2013 excel and when pressing the "F9" key 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
I have read in one of the excel help websites in versions prior to 2007 and possibly 2003 allowed this calculations when not saving the file 2003
2007 format. However not in excel 2013 fie format .xlsx.
So as a solution I made the following formula with using some of the formula:
=INDIRECTADDRESSCELL"row",INDEXIDLIST,MATCHJ93,IDLIST,0,CELL"col",INDEXFirstMonthSelect,,MATCHMIDI93,1,LENI93*1,firstmo
nthkey,4,1
Data nameIDLIST:
FreTICDC
FreTICNC
FreTIC3DS
FreTICNS
FreTIC5WKDS
FreTICIWS
FreN40NC
FreTonAst
FreSPTNC
FreEyeSrm
FreAAESrm

Data name FirstMonthSelect


MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM M M M M M M M M M M M M M M M M M M M M M M M M
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n
t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t
h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h
o 1 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
r
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
B
l
a
n
k

Data name firstmonthkey

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

Data name I93

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

Be the first person to mark this helpful


Helpful

Reply

Still have questions?


Ask the community

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

Anda mungkin juga menyukai