Help on calculation

G

Guest

I am attempting to create a formula that returns a "random" number. I am
taking an IFF and using it to either return a blank if the referenced field
is blank, or do a MOD calculation inclusive of another field. The calulation
looks like this:

=IIF([SSNumber]="","",9-MOD([SumOfTheProduct],9))

I keep getting an error message saying:

The expression you entered contains invalid syntax.
You may have entered a comma without a preceding value or identifier.

When I drop the MOD statement or change it to a number it works properly. I
need to make this work - it does in excel. Any ideas?
 
G

Gina Whipp

MOD is an Excel function not an Access function (someone correct me if I'm
wrong!). MOD in Excel returns the remainder of, so kinda makes me unsure of
what you are trying to accomplish. Perhaps if you expalin what you are
trying to do in Access? it might help soemone get you a formula you can
use. However, if you are using Excel, I would suggest you post your
question to the Excel newsgroup.
 
A

Al Camp

Robb,
The MOD function syntax is...
FirstNo MOD SecondNo
So...
=IIF([SSNumber]="","",9-([SumOfProduct] MOD 9))
should do it.
 
A

Al Camp

Gina,
Access does have a MOD function.
The syntax is...
FirstNo MOD SecondNo
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

Gina Whipp said:
MOD is an Excel function not an Access function (someone correct me if I'm
wrong!). MOD in Excel returns the remainder of, so kinda makes me unsure
of what you are trying to accomplish. Perhaps if you expalin what you are
trying to do in Access? it might help soemone get you a formula you can
use. However, if you are using Excel, I would suggest you post your
question to the Excel newsgroup.


Robb said:
I am attempting to create a formula that returns a "random" number. I am
taking an IFF and using it to either return a blank if the referenced
field
is blank, or do a MOD calculation inclusive of another field. The
calulation
looks like this:

=IIF([SSNumber]="","",9-MOD([SumOfTheProduct],9))

I keep getting an error message saying:

The expression you entered contains invalid syntax.
You may have entered a comma without a preceding value or identifier.

When I drop the MOD statement or change it to a number it works properly.
I
need to make this work - it does in excel. Any ideas?
 
G

Gina Whipp

Thank you for the correction! I have learned something new today!

Al Camp said:
Gina,
Access does have a MOD function.
The syntax is...
FirstNo MOD SecondNo
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

Gina Whipp said:
MOD is an Excel function not an Access function (someone correct me if
I'm wrong!). MOD in Excel returns the remainder of, so kinda makes me
unsure of what you are trying to accomplish. Perhaps if you expalin what
you are trying to do in Access? it might help soemone get you a formula
you can use. However, if you are using Excel, I would suggest you post
your question to the Excel newsgroup.


Robb said:
I am attempting to create a formula that returns a "random" number. I am
taking an IFF and using it to either return a blank if the referenced
field
is blank, or do a MOD calculation inclusive of another field. The
calulation
looks like this:

=IIF([SSNumber]="","",9-MOD([SumOfTheProduct],9))

I keep getting an error message saying:

The expression you entered contains invalid syntax.
You may have entered a comma without a preceding value or identifier.

When I drop the MOD statement or change it to a number it works
properly. I
need to make this work - it does in excel. Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top