Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Formula produces wrong result when data cells filled programmatically

This Formula:

=(IF(E69/50<1,1,E69/50)*3*IF(E69<=0,0,1)*IF(A69=1,0,1)*IF(A69=10,0,1)* IF(A69
=20,0,1))*IF(A69=0,0,1)

Produces a wrong result when I use code to put the numbers in cells A and E.

I didn't write the formula, my job is to produce some fast and fancy (four
levels deep) sorting, but when I write all the data to a recordset and then
re-organize the rows, this formula (which is not transposed, all it's
references are in the same row) produces a wrong result.

For instance with 1 in cell A and 56 in cell E, the answer should be 0, but
it produces 3. It works fine when typing values in by hand.

I've checked that the number formatting of the cell is not being harmed, all
cells are keeping their correct format.
(Number, 0 decimals is what the client wants)

Bob


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Formula produces wrong result when data cells filled programmatically

Works like a champ for me, I used the following to test it.
------------------
Sub TestIt()
Cells(69, 1).Value = 1
Cells(69, 5).Value = 56
End Sub
------------------
Tried this also with values of A67 = 1 and E67 = 56
------------------
Sub TestIt()
Cells(69, 1).Value = Cells(67, 1).Value
Cells(69, 5).Value = Cells(67, 5).Value
End Sub
------------------


"Bob Graham" wrote in message
...
This Formula:


=(IF(E69/50<1,1,E69/50)*3*IF(E69<=0,0,1)*IF(A69=1,0,1)*IF(A69=10,0,1)* IF(A69
=20,0,1))*IF(A69=0,0,1)

Produces a wrong result when I use code to put the numbers in cells A and

E.

I didn't write the formula, my job is to produce some fast and fancy (four
levels deep) sorting, but when I write all the data to a recordset and

then
re-organize the rows, this formula (which is not transposed, all it's
references are in the same row) produces a wrong result.

For instance with 1 in cell A and 56 in cell E, the answer should be 0,

but
it produces 3. It works fine when typing values in by hand.

I've checked that the number formatting of the cell is not being harmed,

all
cells are keeping their correct format.
(Number, 0 decimals is what the client wants)

Bob




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Formula produces wrong result when data cells filled programmatically

I'm putting this stuff into a recordset for the advanced and easy sorting,
there seems to be a problem with the data coming back from the recordset as
text instead of numbers, and even though the cell format still says number,
and it displays correctly, it's not really a number.

I'll report back when I've figured it out.

Bob


"Tumbleweed" wrote in message
...
Works like a champ for me, I used the following to test it.
------------------
Sub TestIt()
Cells(69, 1).Value = 1
Cells(69, 5).Value = 56
End Sub
------------------
Tried this also with values of A67 = 1 and E67 = 56
------------------
Sub TestIt()
Cells(69, 1).Value = Cells(67, 1).Value
Cells(69, 5).Value = Cells(67, 5).Value
End Sub
------------------


"Bob Graham" wrote in message
...
This Formula:



=(IF(E69/50<1,1,E69/50)*3*IF(E69<=0,0,1)*IF(A69=1,0,1)*IF(A69=10,0,1)* IF(A69
=20,0,1))*IF(A69=0,0,1)

Produces a wrong result when I use code to put the numbers in cells A

and
E.

I didn't write the formula, my job is to produce some fast and fancy

(four
levels deep) sorting, but when I write all the data to a recordset and

then
re-organize the rows, this formula (which is not transposed, all it's
references are in the same row) produces a wrong result.

For instance with 1 in cell A and 56 in cell E, the answer should be 0,

but
it produces 3. It works fine when typing values in by hand.

I've checked that the number formatting of the cell is not being harmed,

all
cells are keeping their correct format.
(Number, 0 decimals is what the client wants)

Bob






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide a formula result until cell has been filled Sammy Excel Discussion (Misc queries) 13 May 19th 09 11:26 PM
Result of Formula produces Picture? sharkman Excel Worksheet Functions 3 May 30th 06 09:50 PM
Fill down produces correct formula but wrong answer Jim at SDSU Excel Worksheet Functions 2 March 3rd 06 07:03 PM
FORMULA PRODUCES WRONG RESULT Wildebeest222 Excel Discussion (Misc queries) 2 October 11th 05 09:27 AM
Copy Paste of Formula Produces Incorrect Result JLa Excel Discussion (Misc queries) 1 May 17th 05 06:56 PM


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

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

About Us

"It's about Microsoft Excel"