| RE: Numbers won't sum |
Jonathan VH provided a rated reply to Nancy Ziese on Tuesday, November 03, 2009 1:44 PM |
|
That interesting code aside, it sounds as though column C of your destination sheet may be formatted as Text before the query result set gets dropped in. If you turn on the Number stored as Text warning, do these values get flagged?
|
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
2 |
$212.00 |
548 |
| October |
2 |
$171.00 |
584 |
|
|
|
|
|
|
| response |
| Nancy Ziese replied to Jonathan VH on Tuesday, November 03, 2009 1:56 PM |
|
No and the column is formated as number with 2 decimal places and is still formated the same after the query that brings the data in is run. The formating is the same in the workbook from which the data comes. |
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
0 |
$0.00 |
0 |
| October |
0 |
$0.00 |
0 |
|
|
|
|
|
|
| reponse |
| Nancy Ziese replied to Nancy Ziese on Tuesday, November 03, 2009 1:59 PM |
|
It also displays in the correct format. |
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
0 |
$0.00 |
0 |
| October |
0 |
$0.00 |
0 |
|
|
|
|
|
|
| RE: response |
Jonathan VH provided a rated reply to Nancy Ziese on Tuesday, November 03, 2009 2:20 PM |
|
Do you format the column's cells before or after the query result is dropped in? If after, format them before.
Does the + operator work with the values? I.e. if you use the addition operator on a few of the values rather than the SUM function, is the result still zero? =C14+C15+C16
|
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
2 |
$212.00 |
548 |
| October |
2 |
$171.00 |
584 |
|
|
|
|
|
|
| reply |
| Nancy Ziese replied to Jonathan VH on Tuesday, November 03, 2009 2:28 PM |
|
The column is formated before it is populated.
Oddly enough, =C17+C18+C21+C22+C23+C24 works
=SUM(C17:C24) does not
I cannot use the + operator since I don't know how many rows I will have in the column when it is populated.
|
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
0 |
$0.00 |
0 |
| October |
0 |
$0.00 |
0 |
|
|
|
|
|
|
| RE: reply |
Jonathan VH provided a rated reply to Nancy Ziese on Tuesday, November 03, 2009 3:22 PM |
|
This sounds like the same behavior I mentioned the other day on this thread:
http://www.eggheadcafe.com/community/aspnet/66/10125942/re-sum-values-with-symbo.aspx
My guess is that the values have some characteristic (embedded spaces?) that cause them to be non-numeric. I recommend that you experiment with the values to discover and fix this characteristic of the query values (perhaps try adding IMEX=1 or IMEX=0 to the extended properties of the connection string). Alternatively you could force the values to numeric after they're created, or use a solution like I posted in that thread.
|
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
2 |
$212.00 |
548 |
| October |
2 |
$171.00 |
584 |
|
|
|
|
|
|
| reply |
| Nancy Ziese replied to Jonathan VH on Tuesday, November 03, 2009 6:17 PM |
|
Using your suggestions I cannot find anything that works.
I did discover something interesting.
When I select one of the cells in the column and then click on the formula bar where the value is displayed
then click out of it, the value becomes a number.
Not sure why or how I can use this to change the data type for the entire range. Have any ideas?
|
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
0 |
$0.00 |
0 |
| October |
0 |
$0.00 |
0 |
|
|
|
|
|
|
| RE: reply |
Jonathan VH provided a helpful rated reply to Nancy Ziese on Tuesday, November 03, 2009 6:35 PM |
|
Yes, you are causing the text values to be reevaluated as numbers. You can do that by double-clicking the cells or using F2 (edit) Enter.
If you cannot get the query results to be numeric, then you can change them en masse after they are dropped in by selecting the range and choosing Text to Columns (on the Data ribbon) and then clicking Next, Next, Finish on the dialog boxes.
|
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
2 |
$212.00 |
548 |
| October |
2 |
$171.00 |
584 |
|
|
|
|
|
|
| THANK You |
| Nancy Ziese replied to Jonathan VH on Tuesday, November 03, 2009 6:39 PM |
|
That works and it will be easy. Thank you. |
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
0 |
$0.00 |
0 |
| October |
0 |
$0.00 |
0 |
|
|
|
|
|
|
|