ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Create a formula (https://www.excelbanter.com/excel-discussion-misc-queries/48631-create-formula.html)

B LO

Create a formula
 
I needed to know how or what easy way to create formulas. I wanted to to
create a cell that shows if I enter a number less than three it will show as
negitive and of coruse if it three or higher it stays in the positve?
--
Looking for help.

RagDyer

This formula will display the results you want of a cell *other* then the
cell that contains this formula:

=A1*(-(A1<3)+(A1=3))

--
HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"B LO" wrote in message
...
I needed to know how or what easy way to create formulas. I wanted to to
create a cell that shows if I enter a number less than three it will show

as
negitive and of coruse if it three or higher it stays in the positve?
--
Looking for help.



Dan

Here is a simple function. Need to add this in a module in VBA.

Function test(ByVal intVal As Integer) As Integer
If intVal < 0 Then
test = intVal
ElseIf intVal = 0 And intVal < 3 Then
test = intVal * -1
Else
test = intVal
End If
End Function

"B LO" wrote:

I needed to know how or what easy way to create formulas. I wanted to to
create a cell that shows if I enter a number less than three it will show as
negitive and of coruse if it three or higher it stays in the positve?
--
Looking for help.



All times are GMT +1. The time now is 12:36 AM.

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