+ Reply to Thread
Results 1 to 4 of 4

Nested IF keeps showing me "#NAME?" error [in file created by ClosedXML]

  1. #1
    Registered User
    Join Date
    06-23-2023
    Location
    Italy
    MS-Off Ver
    Office 365
    Posts
    1

    Nested IF keeps showing me "#NAME?" error [in file created by ClosedXML]

    Hi, I'm using the ClosedXML library for Vb .NET to create an excel file with multiple sheets and formulas.
    In each of these sheets I use this formula: =IF(C21="YES",IF(C24="NO",+C34*B41,0),0)
    While it works fine in almost all the sheets, sometimes it shows me a "#NAME?" error, but if I press "Enter" on it the error disappears and it shows me the correct value. I controlled when I pressed "Enter" if Excel edited my formula, but it's the same as before. Does anyone know if it's just a ClosedXML bug or are there any issues in my IF?
    Thanks in regards,
    Riccardo

    PS: in this case, C21 and C24 are "YES", while C34 = "0,00$" and B41 = "0,00%"
    Attached Images Attached Images
    Last edited by 6StringJazzer; 06-23-2023 at 10:03 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Nested IF keeps showing me "#NAME?" error [in file created by ClosedXML]

    Check out, =if(and(

    https://support.microsoft.com/en-gb/...2-5c193a236d97

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Nested IF keeps showing me "#NAME?" error [in file created by ClosedXML]

    ClosedXML is an open-source library for creating Excel files without using Excel. It is primarily intended for web applications that need to generate Excel files for user download.

    The formula you say you are using has the English function IF but your screenshot shows the Italian function SE. What does the code look like that calls ClosedXML?

    I don't know what level of support is provided, if any at all. From your description I would guess that the problem is that it is creating an Excel file using English names for the functions and you are opening it in a regionalization that uses Italian names. The specification for ClosedXML does not indicate whether it has been designed and tested for regionalizations other than U.S.

    My guess is it's a bug in ClosedXML, but I don't know if it's a known bug. This is one drawback of using free open-source code. Is there a community forum specific to ClosedXML where you can ask this question?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Nested IF keeps showing me "#NAME?" error [in file created by ClosedXML]

    BTW
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    the "+" is unnecessary

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA code showing error "Run time error 424 object required"
    By keshavtale in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-14-2021, 09:58 AM
  2. [SOLVED] VBA code not running and showing error "No cells were found"
    By keshavtale in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-13-2021, 11:06 AM
  3. Replies: 35
    Last Post: 01-13-2016, 02:16 AM
  4. Showing Run-time error "1004" when executing code with thousans of data
    By nigel_12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-28-2013, 07:03 AM
  5. Replies: 2
    Last Post: 11-01-2012, 04:35 PM
  6. Nested IFs and error message "uses more levels of nesting than allowed"
    By pannassi in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-09-2012, 11:48 AM
  7. [SOLVED] How to Count number of "Error" and "OK" after the word "Instrument" found in table row
    By eltonlaw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2012, 06:26 AM

Tags for this Thread

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