Which of these 2 functions should I choose?

MyTech

Access VBA
Local time
Today, 04:03
Joined
Jun 10, 2010
Messages
108
A quick question.

Which of these 2 functions should I use - which one will use less CPU etc?


I want to return "1" for every 3,6,8,11,14,17 or 19th of every 19 numbers, and a "0" for the others.

  1. IF(MOD(MOD(MOD(MOD(MOD(MOD(MOD(<Number>,19),17),14),11),8),6),3)=0,1,0)
  2. CHOOSE(MOD(<Number>-1,19)+1,0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,1)

I believe #2 will do much less work, tell me if I am wrong.
 
Because this is the Access section of the forum I will say NONE. :)

Are you doing this in Excel?
 
I'm planning to do it in access, I just do now the testings in Excel.
 
Not the ideal way of going about things. Access and Excel are two different applications and there are lots of differences in the way to reach a solution.

The Access way would be to use a SELECT case statement in a function.
 
Right, thank you.

I didn't think enough (of the 'interpreting to Access' part) before asking.
 

Users who are viewing this thread

Back
Top Bottom