PC Review


Reply
Thread Tools Rate Thread

Calculating two fields with a minimum value

 
 
PennyB
Guest
Posts: n/a
 
      1st Jul 2009

I am multiplying two fields together, but if the value is less that .50 I
need it to equal .50. Currently I am using the control source expression
building to calculate the two fields "=[Valuation]*[Factor]".

Any suggestions would be helpful.
 
Reply With Quote
 
 
 
 
Jack Leach
Guest
Posts: n/a
 
      1st Jul 2009
Try an immediate If statement...

=Iif([Valuation]*[Factor] < 0.5, 0.5, [Valuation]*[Factor])

hth

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)



"PennyB" wrote:

> I am multiplying two fields together, but if the value is less that .50 I
> need it to equal .50. Currently I am using the control source expression
> building to calculate the two fields "=[Valuation]*[Factor]".
>
> Any suggestions would be helpful.

 
Reply With Quote
 
PennyB
Guest
Posts: n/a
 
      1st Jul 2009

Thank you so much. It works perfect. I have another one for you if you can
help me.

I have a fee that needs to calculate on Valuation. The catch is it is $1.00
per every $25,000 or fraction there of. So if the valuation is less than
$25,000 it will be $1.00 and if it is $25,001 then it is $2.00.

Any suggestions on how to calculate this one?

Thanks again.


"PennyB" wrote:

> I am multiplying two fields together, but if the value is less that .50 I
> need it to equal .50. Currently I am using the control source expression
> building to calculate the two fields "=[Valuation]*[Factor]".
>
> Any suggestions would be helpful.

 
Reply With Quote
 
Graham Mandeno
Guest
Posts: n/a
 
      2nd Jul 2009

Hi Penny

If it's in a query, then this should work:

Fee: Int(Valuation/25000)-(Int(Valuation/25000)<>(Valuation/25000))

--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

"PennyB" <(E-Mail Removed)> wrote in message
news:F9CC79D1-F728-4C27-90DA-(E-Mail Removed)...
> Thank you so much. It works perfect. I have another one for you if you
> can
> help me.
>
> I have a fee that needs to calculate on Valuation. The catch is it is
> $1.00
> per every $25,000 or fraction there of. So if the valuation is less than
> $25,000 it will be $1.00 and if it is $25,001 then it is $2.00.
>
> Any suggestions on how to calculate this one?
>
> Thanks again.
>
>
> "PennyB" wrote:
>
>> I am multiplying two fields together, but if the value is less that .50 I
>> need it to equal .50. Currently I am using the control source expression
>> building to calculate the two fields "=[Valuation]*[Factor]".
>>
>> Any suggestions would be helpful.



 
Reply With Quote
 
John Spencer MVP
Guest
Posts: n/a
 
      2nd Jul 2009

Evan easier. The following will do it in a query or in VBA or ...

-Int(-Valuation/25000)

and if you want the fee to be some other multiple just multiply the above by
that number.


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Graham Mandeno wrote:
> Hi Penny
>
> If it's in a query, then this should work:
>
> Fee: Int(Valuation/25000)-(Int(Valuation/25000)<>(Valuation/25000))
>

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      2nd Jul 2009

On Thu, 02 Jul 2009 10:26:48 -0400, John Spencer MVP <(E-Mail Removed)>
wrote:

>Evan easier. The following will do it in a query or in VBA or ...
>
> -Int(-Valuation/25000)
>
>and if you want the fee to be some other multiple just multiply the above by
>that number.


I'll see you an Int and raise you an integer divide:

-(-Valuation\25000)

--

John W. Vinson [MVP]
 
Reply With Quote
 
John Spencer MVP
Guest
Posts: n/a
 
      2nd Jul 2009

Be careful John.

Integer divide will give you different results.

The user wants 2 if Valuation is 25001, your expression returns 1

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

John W. Vinson wrote:
> On Thu, 02 Jul 2009 10:26:48 -0400, John Spencer MVP <(E-Mail Removed)>
> wrote:
>
>> Evan easier. The following will do it in a query or in VBA or ...
>>
>> -Int(-Valuation/25000)
>>
>> and if you want the fee to be some other multiple just multiply the above by
>> that number.

>
> I'll see you an Int and raise you an integer divide:
>
> -(-Valuation\25000)
>

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      2nd Jul 2009

On Thu, 02 Jul 2009 14:55:00 -0400, John Spencer MVP <(E-Mail Removed)>
wrote:

>Be careful John.
>
>Integer divide will give you different results.
>
>The user wants 2 if Valuation is 25001, your expression returns 1


<d'oh!>

Quite true. How about just

1+[Valuationi]\25000

then?
--

John W. Vinson [MVP]
 
Reply With Quote
 
John Spencer
Guest
Posts: n/a
 
      3rd Jul 2009

As long as there is no decimal portion, I think that will work.

24999.51 will return 2 instead of 1. Integer division converts the
numbers to integer values before doing the arithmetic and then converts
the result to an integer value

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================


John W. Vinson wrote:
> On Thu, 02 Jul 2009 14:55:00 -0400, John Spencer MVP <(E-Mail Removed)>
> wrote:
>
>> Be careful John.
>>
>> Integer divide will give you different results.
>>
>> The user wants 2 if Valuation is 25001, your expression returns 1

>
> <d'oh!>
>
> Quite true. How about just
>
> 1+[Valuationi]\25000
>
> then?

 
Reply With Quote
 
Graham Mandeno
Guest
Posts: n/a
 
      4th Jul 2009

Very nifty, John!
:-)
--
Cheers,
Graham

"John Spencer MVP" <(E-Mail Removed)> wrote in message
news:OSNpjEy%(E-Mail Removed)...
> Evan easier. The following will do it in a query or in VBA or ...
>
> -Int(-Valuation/25000)
>
> and if you want the fee to be some other multiple just multiply the above
> by that number.
>
>
> John Spencer
> Access MVP 2002-2005, 2007-2009
> The Hilltop Institute
> University of Maryland Baltimore County
>
> Graham Mandeno wrote:
>> Hi Penny
>>
>> If it's in a query, then this should work:
>>
>> Fee: Int(Valuation/25000)-(Int(Valuation/25000)<>(Valuation/25000))
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
calculating a minimum fee Jackie Microsoft Excel Worksheet Functions 3 8th Jan 2010 09:29 PM
Calculating the minimum value from a range of times afarrow Microsoft Excel Discussion 3 16th Jun 2008 08:18 AM
Calculating value less minimum numbers in the sequence =?Utf-8?B?S2FyZW41Mw==?= Microsoft Excel Worksheet Functions 4 29th Oct 2007 07:56 PM
using min function without calculating 0 as minimum chusu Microsoft Excel New Users 2 4th Oct 2007 05:32 AM
calculating the minimum value ignoring o =?Utf-8?B?am8gam8=?= Microsoft Excel Worksheet Functions 1 29th Jun 2005 11:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:56 AM.