I have been working on a fairly large and complex workbook. I have had to make several compromises regarding speed and optimizations vs extra columns and formula options etc.
Thanks to board searches, and advice from others I am getting fairly close being finished.
I then ran into a new interesting problem. I need to calculate a far number of percentages. About 6 worksheets each with a matrix of 10 x 4 of the formula of c4/$g4 (adjusted based on the cell location).
That did not slow my worksheet down much more then its current speed.
Then i realized i was getting several #DIV/0! errors. So then I created a formula of =IF($G4=0,0,C4/$G4). I replaced all my percentage calculations with that and things just slowed down.
I thought I remembered reading that if the IF statement evaluated one way most of the time it was faster to have option first so I swapped the formula to be =IF($G4<>0,C4/$G4,0).
Unfortunately that was not any faster and could have been even a little slower.
So my questions are...
1. What is are the various most efficient options to hide #DIV/0
2. Are if statements really that slow for something like this?
3. What is faster =IF($G4=0,0,C4/$G4) or =IF($G4<>0,C4/$G4,0) if most of the time G4 will NOT be zero.
Would I do better to return text like "-" or something?
thanks for the help
Alan
I tried to add various keywords to the post in case the response could help others that are searching.
Thanks to board searches, and advice from others I am getting fairly close being finished.
I then ran into a new interesting problem. I need to calculate a far number of percentages. About 6 worksheets each with a matrix of 10 x 4 of the formula of c4/$g4 (adjusted based on the cell location).
That did not slow my worksheet down much more then its current speed.
Then i realized i was getting several #DIV/0! errors. So then I created a formula of =IF($G4=0,0,C4/$G4). I replaced all my percentage calculations with that and things just slowed down.
I thought I remembered reading that if the IF statement evaluated one way most of the time it was faster to have option first so I swapped the formula to be =IF($G4<>0,C4/$G4,0).
Unfortunately that was not any faster and could have been even a little slower.
So my questions are...
1. What is are the various most efficient options to hide #DIV/0
2. Are if statements really that slow for something like this?
3. What is faster =IF($G4=0,0,C4/$G4) or =IF($G4<>0,C4/$G4,0) if most of the time G4 will NOT be zero.
Would I do better to return text like "-" or something?
thanks for the help
Alan
I tried to add various keywords to the post in case the response could help others that are searching.