• IF function problem,

    From annae@21:1/5 to All on Fri Sep 13 14:23:26 2019
    I'm trying to calculate a maximum amount of value. That is, if a value
    is higher than 50000, it needs to display 50000. If not, display current
    value.

    A1=35678
    B1 should display 35678 (that is, equal to A1)

    A1=67980
    B1 should display 50000




    --
    annae

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Claus Busch@21:1/5 to All on Fri Sep 13 15:52:47 2019
    Hi,

    Am Fri, 13 Sep 2019 14:23:26 +0100 schrieb annae:

    I'm trying to calculate a maximum amount of value. That is, if a value
    is higher than 50000, it needs to display 50000. If not, display current value.

    A1=35678
    B1 should display 35678 (that is, equal to A1)

    A1=67980
    B1 should display 50000

    try:
    =MIN(A1,50000)


    Regards
    Claus B.
    --
    Windows10
    Office 2016

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nasser Saadi@21:1/5 to annae on Wed Sep 18 09:36:18 2019
    On Friday, September 13, 2019 at 4:49:08 PM UTC+3, annae wrote:
    I'm trying to calculate a maximum amount of value. That is, if a value
    is higher than 50000, it needs to display 50000. If not, display current value.

    A1=35678
    B1 should display 35678 (that is, equal to A1)

    A1=67980
    B1 should display 50000




    --
    annae

    Public Sub Answeer1()
    ' Prepared By Nasser Saadi (www.Nasser-Saadi.org)
    ' Date: 2019-Sep-19
    ' Address: Iraq (Or Arbil Or Irbil)
    ' ------------------------
    Dim A1, B1 As Integer:
    A1 = 23445
    B1 = IIf(A1 >= 50000, 50000, A1)
    ' we can use one of display (Msgbox or Print)
    MsgBox " A1= " & A1 & " B1= " & B1
    Debug.Print " A1= " & A1 & " B1= " & B1


    End Sub

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nasser Saadi@21:1/5 to annae on Wed Sep 18 09:32:26 2019
    On Friday, September 13, 2019 at 4:49:08 PM UTC+3, annae wrote:
    I'm trying to calculate a maximum amount of value. That is, if a value
    is higher than 50000, it needs to display 50000. If not, display current value.

    A1=35678
    B1 should display 35678 (that is, equal to A1)

    A1=67980
    B1 should display 50000




    --
    annae
    Public Sub Answeer1()
    ' Prepared By Nasser Saadi (www.Nasser-Saadi.org)
    ' Date: 2019-Sep-19
    ' Address: Iraq (Or Arbil Or Irbil)
    ' ------------------------
    Dim A1, B1 As Integer:
    A1 = 23445
    B1 = IIf(A1 >= 50000, 50000, A1)
    MsgBox " A1= " & A1 & " B1= " & B1 ' we can use one of display (Msgbox or Print)
    Print " A1= " & A1 & " B1= " & B1 ' we can use one of display (Msgbox or Print)

    End Sub

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?ISO-8859-1?Q?Beno=EEt?=@21:1/5 to Nasser Saadi on Wed Sep 18 19:54:39 2019
    Nasser Saadi <kurd.gov@gmail.com> wrote:

    On Friday, September 13, 2019 at 4:49:08 PM UTC+3, annae wrote:
    I'm trying to calculate a maximum amount of value. That is, if a value
    is higher than 50000, it needs to display 50000. If not, display current value.

    A1=35678
    B1 should display 35678 (that is, equal to A1)

    A1=67980
    B1 should display 50000


    B1 = IIf(A1 >= 50000, 50000, A1)

    Formula in B1: =if(A1>50000,50000,A1)

    Just one "i" ;)

    --
    Vie : n.f. maladie mortelle sexuellement transmissible
    Benoit chez lui à leraillez.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)