Forum Discussion

FICO's avatar
FICO
Community Manager
2 years ago

Data Input from Excel

Hello,

I am having trouble reading the data from an excel spreadsheet into my model.

I get the error message saying "wrong number of columns".

I tried the following:

CodeExcel Spreadsheet

It also didn't work when naming the cell ranges in excel.

Any help is appreciated. Thank you!

2 Replies

  • FICO's avatar
    FICO
    Community Manager

    Your model reads the index sets separately from the arrays, this means that you need to indicate 'noindex' format when reading the latter:

    MIN_VEHICLES as 'noindex;[D3:F3]'
    MAX_VEHICLES as 'noindex;[D4:F4]'
    COSTS as 'noindex;[D8:F12]'
    DEMAND as 'noindex;[C8:C12]'

    Please see the documentation of spreadsheet driver format options in the Mosel Language Reference Manual: mmsheet (fico.com)

  • FICO's avatar
    FICO
    Community Manager

    Thank you! It works now. And thanks for the link, it helps a lot.