Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8621145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:45:13+00:00 2026-06-12T06:45:13+00:00

I am writing values in an excel sheet using a MATLAB program. I am

  • 0

I am writing values in an excel sheet using a MATLAB program. I am also writing values in cells using formulas (for e.g. the MATLAB program writes =AVERAGE(A1:A10) to a cell and this gets converted to appropriate value (i.e. when I open the sheet, I don’t see the above formula text, rather the value).

However I am having trouble writing array formulas (ones with curly braces around). Usually a user enters them by pressing Ctrl+Shift+Enter combination, curly braces appear and appropriate value is computed. However when I write these formulas enclosed in curly braces from MATLAB program the value is not computed, I simply see the formula text (with curly braces around it).
It seems I am not able to simulate Ctrl+Shift+Enter effect by simply writing the array formula to a cell.

Is there any solution to this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:45:14+00:00Added an answer on June 12, 2026 at 6:45 am

    Excel auto-converts values that start with = into .formulas.
    To save an array formula, you need to write directly to the FormulaArray property of the range.

    More Details:

    If you’re using a normal formula then you have two options in VBA. You can set the cell’s value or formula properties like this:

    Range("A3").value = "=Sum(A1:A2)"
    Range("A3").Formula= "=Sum(A1:A2)" 
    

    When using array formulas, you cant use either of these approaches, you need to store it into a different area of the cell:

    Range("A3").FormulaArray = "=Sum(A1:A2)"
    

    When the user pushed Ctrl+Shift+Enter they are telling excel to send the .value of the cell into the .FormulaArray section of the cell.

    Otherwise by default when excel sees the = sign i assigns the .value into the .formula

    Anyways, this is all relative the the excel object model even if it’s in VBA.

    Now that I’ve gone into that detail I believe that matlab’s xlswrite function only writes to the value of cells, and cant write to this sub-property, I may be wrong.

    Something liek this may work in MATLAB (untested)

    mlrange='A3'; % or similar
    
    Excel = actxserver ('Excel.Application');
    Excel.Workbooks.Open(filename);
    TargetSheet = get(Excel.sheets,'item','A');
    TargetSheet.Activate
    ran = Excel.Activesheet.get('Range',mlrange);
    ran.FormulaArray = '=Sum(A1:A2)'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why can I not write values to Excel using the Worksheet class, or Sheet
I am writing a excel sheet with various floating values . It is absolutely
Why is it that writing cell values to Excel is a lot faster in
I'm writing a small function to generate values from the Normal distribution using Box-Muller
So far all the Excel stuff revolves around opening a file, writing values to
I am using the excel pia's to do some writing and reading to/from excel
I'm writing an application that pulls values out of an Excel spreadsheet and then
I am writing a program to fill Excel work books with data, but at
I am writing a bit of code to read an excel file. At this
I am writing a program that will allow me to open excel spreadsheets and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.