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 9207691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:26:36+00:00 2026-06-18T00:26:36+00:00

Hello Java Developers, Here’s a straight question. How would I be able to set

  • 0

Scenario

Hello Java Developers,

Here’s a straight question. How would I be able to set the Cell’s formula within a loop in Apache POI?

Here’s an information to support my question:

Illustration 1: Cell C1 has the formula of SUM(C6:C7) which can be done by simply hard coding the formula myCell.setCellFormula("SUM(C6:C7)").
On the other hand:

Illustration 2: This is my desired output. I want to set a formula on Cells C1, D1, and E1 for example. How can this be done within a loop?

Why would I want it within a loop?
– Hard-coding would be tiresome. 3 cells are just and example. Currently I have hundreds of cells waiting for their formula.
– Row count are not specified, it will be based on the number of rows created by the program.

What I have done?
– Googled.
– Searched for similar question.
– Apache POI’s column is represented by an Integer (Number of cells within a row).

The formula requires Alpha C2 (Column C, Row 2). I tried to loop through the Spreadsheet and realized that if I continue, the formula will result to SUM(26:27) (Where: 2 = Column C, and Row 6(Base 1: rowCount + 1) which I want to be SUM(C6:C7)

  • 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-18T00:26:37+00:00Added an answer on June 18, 2026 at 12:26 am

    I have finally solved the problem.
    CellReference.convertNumToColString(myColumnNumber) will return the column name

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

Sidebar

Related Questions

hello fellow java developers. I'm having a bit of an issue here. I have
Possible Duplicate: Appending files to a zip file with Java Hello Java Developers, Here's
Hello I am a Java web app developer I have a problem, I would
Hello Java Developers, I've never encountered this scenario so far. This scenario is: (To
hello fellow java developers. I'm having a very strange issue. I'm trying to read
Hello android/Java developers, When a function call a function and that function call another
Hello Python developers! I'm a Java one and I know that there is a
I created a hello world java program and use lauch4j to convert executable jar
Take the following Java string: Hello, World I want to take that string and
Hello :) I am beginner in Java Swing and I can't google solution for

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.