Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
The following sample code illustrates the calculation of IFNA function by Aspose.Cells.
#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
int main()
{
Aspose::Cells::Startup();
// Create new workbook
Workbook workbook;
// Access first worksheet
Worksheet worksheet = workbook.GetWorksheets().Get(0);
// Add data for VLOOKUP
worksheet.GetCells().Get(u"A1").PutValue(u"Apple");
worksheet.GetCells().Get(u"A2").PutValue(u"Orange");
worksheet.GetCells().Get(u"A3").PutValue(u"Banana");
// Access cell A5 and A6
Cell cellA5 = worksheet.GetCells().Get(u"A5");
Cell cellA6 = worksheet.GetCells().Get(u"A6");
// Assign IFNA formula to A5 and A6
cellA5.SetFormula(u"=IFNA(VLOOKUP(\"Pear\",$A$1:$A$3,1,0),\"Not found\")");
cellA6.SetFormula(u"=IFNA(VLOOKUP(\"Orange\",$A$1:$A$3,1,0),\"Not found\")");
// Calculate the formula of workbook
workbook.CalculateFormula();
// Print the values of A5 and A6
std::cout << cellA5.GetStringValue().ToUtf8() << std::endl;
std::cout << cellA6.GetStringValue().ToUtf8() << std::endl;
Aspose::Cells::Cleanup();
}
Here is the console output of the above sample code.
Not found
OrangeAnalyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.