Use MarketXLS formulas
Enter symbols, refer to cells, copy formulas, and understand common MarketXLS results.
A MarketXLS formula works like a standard Excel formula. It starts with an equals sign, contains a function name, and uses values or cell references as inputs.
Enter a formula
- Put a stock symbol, such as
MSFT, in cell A2. - Select cell B2.
- Enter the formula for your add-in:
- Windows:
=Last(A2) - Mac or Excel for the web:
=mxls.Last(A2)
- Windows:
- Press Enter.
Capture formula autocomplete with several current MarketXLS functions visible.
/images/docs/shared/formula-autocomplete.webp
Use quotation marks when you type a symbol directly in a formula, as in =Last("MSFT"). Don't use quotation marks around a cell reference.
Copy a formula to more symbols
- Add more symbols below A2.
- Select the formula cell in B2.
- Drag the fill handle down the column, or copy and paste the cell.
- Check that each copied formula points to the symbol in the same row.
Excel adjusts a relative reference such as A2 when you copy the formula. Add dollar signs when you need an absolute reference, such as $A$2.
Understand common results
| Result | What it usually means | What to do |
|---|---|---|
| A number or text value | The function returned data | No action is needed |
#NAME? | Excel doesn't recognize the function | Fix a #NAME? error |
NA | The source didn't return a value for the request | Check the symbol, period, and data coverage |
| A previous value | The workbook or data source hasn't updated yet | Refresh the workbook |
Find more formulas
Open the MarketXLS formula reference. Filter by category, and check the platform labels before you add a formula to a shared workbook.
Use Check whether a function works on your add-in when you copy a formula from another platform or an older workbook.
Capture a clean mxls.Last formula with its returned value.
/images/docs/microsoft-365/first-formula.webp