Results 1 to 6 of 6

UDF to keep current value on FALSE from IF statement

Threaded View

  1. #1
    Registered User
    Join Date
    04-27-2020
    Location
    India
    MS-Off Ver
    2016
    Posts
    17

    UDF to keep current value on FALSE from IF statement

    Hi,

    I am using the below UDF to retain old value when if condition is false.

    Formula I am using is :
    =IF(AND(C9="Short",C10="Call",C11=9600),INDEX(OptionChain,MATCH(C11,OptionChain[Strike Price],0),9),CurrentValue())

    Code of CurrentValue() is :
    Function CurrentValue() As Variant
    CurrentValue = Application.Caller.Value
    If Val(CurrentValue) Then
    CurrentValue = Val(CurrentValue)
    ElseIf IsNumeric(CurrentValue) Then
    CurrentValue = Val(CurrentValue)
    End If
    End Function

    When IF statement condition is met, cell changes as per index search value but when condition is not met, value remains unchanged but I am getting message circular reference error.

    Kindly help me correct my UDF. Thanks in advance


    Rgds,
    Dhruv
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] IF statement with IF Statement as logical test, and output if false
    By wetbean in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-19-2018, 12:59 PM
  2. [SOLVED] Retain current cell value, if the next iteration returns false
    By sipa in forum Excel General
    Replies: 10
    Last Post: 11-07-2014, 03:11 PM
  3. [SOLVED] How can IIF Statement bring false statement?
    By jgomez in forum Access Tables & Databases
    Replies: 5
    Last Post: 07-19-2013, 06:16 PM
  4. Return True or False if date range falls within current month
    By kieran614 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-17-2013, 12:02 PM
  5. If statement, answer is false, hide false.
    By Mel B in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-07-2013, 06:36 PM
  6. If statement with a range and true/false statement
    By aarleblanc in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-20-2012, 06:34 PM
  7. If statement that does nothing when false
    By higherlimits in forum Excel General
    Replies: 1
    Last Post: 05-26-2006, 01:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1