Excel function list in C# - IF missing?

Feb 24 at 9:58 AM
Hi,

I'm writing a C# tool to scrape Excel files to extract all function names, using Regex to parse the formulae in each used cell. I then want to remove all Excel function names and leave a list of our own functions. I thought I could look at XLCall and filter on names starting with xlf:
public static class ExcelFunctionNames
{
    private static IEnumerable<string> _excelFunctionNames;

    static ExcelFunctionNames()
    {
        // build a list of Excel functions
        string excelObjectType = "xlf"; // for excel functions
        _excelFunctionNames = typeof(XlCall).GetFields()
                                            .Where(x => x.Name.Contains(excelObjectType))
                                            .Select(x => x.Name.Replace(excelObjectType, "")
                                            .ToUpper());
    }

    public static bool IsExcelFunction(string functionName)
    {
        return _excelFunctionNames.Contains(functionName.ToUpper());
    }
}
This appeared to work, until I noticed that the function IF does not appear in the list. Is IF intentionally omitted and why? Is there a better way to list all the standard Excel functions in C#?

Thanks in advance.

Brian