ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   programming assistance (https://www.excelbanter.com/excel-discussion-misc-queries/151886-programming-assistance.html)

biker man

programming assistance
 
I want to write a program that takes a
number,x, from cell A3 and a positive integer, n, from cell B3 then
returns into cell C3 the value of x raised to the power n divided by
n factorial.

i want to add error checking so that a negative value of n cannot be
used

i entered this in cell C3

=IF(B3=",", IF(B3<=0," Integer in B3 must be positive",(A3^B3)/B3)

but all i get is a FALSE coem up in the cell

but i need to return in cell C3 the value of x raised to the power n
divided by n factorial.

Also do i need to write anyhting in VBA for this too work or not???

any help


BigPig

programming assistance
 
how about

=IF(B3<"",IF(B3<=0," Integer in B3 must be positive",(A3^B3)/B3))


"biker man" wrote:

I want to write a program that takes a
number,x, from cell A3 and a positive integer, n, from cell B3 then
returns into cell C3 the value of x raised to the power n divided by
n factorial.

i want to add error checking so that a negative value of n cannot be
used

i entered this in cell C3

=IF(B3=",", IF(B3<=0," Integer in B3 must be positive",(A3^B3)/B3)

but all i get is a FALSE coem up in the cell

but i need to return in cell C3 the value of x raised to the power n
divided by n factorial.

Also do i need to write anyhting in VBA for this too work or not???

any help



Bob Phillips

programming assistance
 
=IF(B3="","",IF(B3<=0,"Integer in B3 must be positive",(A3^B3)/B3))

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"biker man" wrote in message
ups.com...
I want to write a program that takes a
number,x, from cell A3 and a positive integer, n, from cell B3 then
returns into cell C3 the value of x raised to the power n divided by
n factorial.

i want to add error checking so that a negative value of n cannot be
used

i entered this in cell C3

=IF(B3=",", IF(B3<=0," Integer in B3 must be positive",(A3^B3)/B3)

but all i get is a FALSE coem up in the cell

but i need to return in cell C3 the value of x raised to the power n
divided by n factorial.

Also do i need to write anyhting in VBA for this too work or not???

any help




Dave O

programming assistance
 
Here's one answer:

=IF(B3<=0,"Integer in B" & ROW() &" must be positive",(A3^B3)/
FACT(B3))

ROW() returns the formula's row number, in case you need to apply this
formula to different cells.



All times are GMT +1. The time now is 11:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com