![]() |
How to sum a cell?
i am trying to sum a number into single number? eg 1347 --- 25 please help |
How to sum a cell?
eg 1347 --- 25
Shouldn't that be 15? Biff "willie Loh" <willie wrote in message ... i am trying to sum a number into single number? eg 1347 --- 25 please help |
How to sum a cell?
eg 1347 --- 25
Shouldn't that be 15? A1 = 1347 =SUMPRODUCT(--MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)) Returns 15 Biff "Biff" wrote in message ... eg 1347 --- 25 Shouldn't that be 15? Biff "willie Loh" <willie wrote in message ... i am trying to sum a number into single number? eg 1347 --- 25 please help |
How to sum a cell?
I have seen the use of "--" in a few responses here and in other groups
but fail to understand what the 2 '--'s do or why they are necessary. I see that 1 - returns a negative, therefore 2 -'s return a positive, but why does + or nothing, that is "(MID(....") return 0? Can you explain? Thanks Biff wrote: eg 1347 --- 25 Shouldn't that be 15? A1 = 1347 =SUMPRODUCT(--MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)) Returns 15 Biff "Biff" wrote in message ... eg 1347 --- 25 Shouldn't that be 15? Biff "willie Loh" <willie wrote in message ... i am trying to sum a number into single number? eg 1347 --- 25 please help |
How to sum a cell?
thks bro, it work.
"noyb" wrote: I have seen the use of "--" in a few responses here and in other groups but fail to understand what the 2 '--'s do or why they are necessary. I see that 1 - returns a negative, therefore 2 -'s return a positive, but why does + or nothing, that is "(MID(....") return 0? Can you explain? Thanks Biff wrote: eg 1347 --- 25 Shouldn't that be 15? A1 = 1347 =SUMPRODUCT(--MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)) Returns 15 Biff "Biff" wrote in message ... eg 1347 --- 25 Shouldn't that be 15? Biff "willie Loh" <willie wrote in message ... i am trying to sum a number into single number? eg 1347 --- 25 please help |
How to sum a cell?
The -- is used when we want to convert textual values to their numeric
equivalent. In the above example, MID returns text. If it happens that the text represents a number, it can be used in numeric calculations if it is converted to a number. The same happens for values returning true or false: even though in an explicit calculation true=1 and false=0, if these values are found in an array and you want, e.g. SUM(A1:A10), and some of these cells contain true, it will be ignored instead of counting as 1. If you want to sum all these values, including T/F, you could use: =SUM(--A1:A10) but then you would have to array-enter it (Shift+Ctrl+Enter). HTH Kostis Vezerides |
How to sum a cell?
Thanks
vezerid wrote: The -- is used when we want to convert textual values to their numeric equivalent. In the above example, MID returns text. If it happens that the text represents a number, it can be used in numeric calculations if it is converted to a number. The same happens for values returning true or false: even though in an explicit calculation true=1 and false=0, if these values are found in an array and you want, e.g. SUM(A1:A10), and some of these cells contain true, it will be ignored instead of counting as 1. If you want to sum all these values, including T/F, you could use: =SUM(--A1:A10) but then you would have to array-enter it (Shift+Ctrl+Enter). HTH Kostis Vezerides |
All times are GMT +1. The time now is 05:46 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com