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

  • Home
  • SEARCH
  • 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 6750531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:49:06+00:00 2026-05-26T12:49:06+00:00

I am use aspose excel export. I am setting formulla in .net. I want

  • 0

I am use aspose excel export. I am setting formulla in .net.

I want sum of two cells value in third cell. like

excelbook.Worksheets[0].Cells[“A2”].R1C1Formula = “=SUM(R1C1,R1C2)”;

but i want to set the column dynamically. like in above formulla column C1,C2 are fixed.

now i want pick the column name dynamically , i want to build my formulla like below

excelbook.Worksheets[0].Cells[“A2”].R1C1Formula = “=SUM(R1C(Value of Cell B1),R1C(Value of Cell B2))”;

so if i enter 1 in B1 cell and 3 in B2 cell then it should sum A1 and C1.i can enter any value in B1 and B2 cell and excel should calculate the sum based upon entered values.

Please suggest how to build this type of formulla.

directly in excel we can do by this way:-

=INDIRECT(B1&1)+INDIRECT(B2&1)

so please suggest can i use INDIRECT in r1c1 formulla or suggest some other way.

  • 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-05-26T12:49:07+00:00Added an answer on May 26, 2026 at 12:49 pm

    If you want to add D1 and E1 in Excel but you want to select the row based on the value of the particular cell; for example, in this case, you might use A1 and A2 to place the value of the row to select, then you will use the formula like this:

    =SUM(INDIRECT(“D”&$A$1),INDIRECT(“E”&$A$2))

    You can assign the same formula using Aspose.Cells for .NET as well. Please see the following code:

            //create XLS File
            //Instantiate a Workbook object that represents Excel file.
            //create a workbook
            Workbook CellsDocument = new Workbook();
            //Note when you create a new workbook, a default worksheet
            //"Sheet1" is added (by default) to the workbook.
            //Access the first worksheet "Sheet1" in the book.
            Worksheet sheet = CellsDocument.Worksheets[0];
            //Access the cells and put values
            Aspose.Cells.Cell cellA1 = sheet.Cells["A1"];
            cellA1.PutValue(1);
    
            Aspose.Cells.Cell cellA2 = sheet.Cells["A2"];
            cellA2.PutValue(1);
    
            Aspose.Cells.Cell cellD1 = sheet.Cells["D1"];
            cellD1.PutValue(4);
    
            Aspose.Cells.Cell cellE1 = sheet.Cells["E1"];
            cellE1.PutValue(5);
    
            Aspose.Cells.Cell cellE14 = sheet.Cells["E14"];
            cellE14.R1C1Formula = "=SUM(INDIRECT(\"D\"&$A$1),INDIRECT(\"E\"&$A$2))";
    
    
            //Save the Excel file.
            CellsDocument.Save("output.xls", Aspose.Cells.SaveFormat.Excel97To2003);
    

    Please try it at your end using the latest version of the Aspose.Cells for .NET. If you think it doesn’t help or I’m unable to understand your question clearly then please share your further thoughts.

    Disclosure: I work as a developer evangelist at Aspose.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Aspose cells to manipulate Excel spreadsheets. One of the types in
use LWP::Simple; use Parallel::ForkManager; @links=( [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-2.1-windows.exe,SweetHome3D-2.1-windows.exe], [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-2.1-macosx.dmg,SweetHome3D-2.1-macosx.dmg], [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3DViewer-2.1.zip,SweetHome3DViewer-2.1.zip], ); # Max 30 processes for
Use case: I've just entered insert mode, and typed some text. Now I want
I am trying to use Aspose.Words library through COM Interop. There is one critical
Use of java.net.URLConnection is asked about pretty often here, and the Oracle tutorial is
is there a (.net-)library for creating PowerPoint-Presentations (PPTX => OpenXML). For creating Excel-sheets I
Use Elixir and have two entities -- Voter and Candidate -- with many to
I use Aspose to generate a Word document. It must be opened in the
Use default: <input type=radio name=restype value=resdef onfocus=document.getElementById('resupload').disabled = true; document.getElementById('resadres').disabled = true; checked=checked /><br
use PHP and MySQL and want to use SELECT statement which date_post(datetime variable) start

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.