title: How to get a cell's name in Excel in java using POI?
body: <p>I am trying to learn POI and I have a sample code.</p>
  
  <pre><code>import org.apache.poi.hssf.usermodel.HSSFCell;
  import org.apache.poi.hssf.usermodel.HSSFSheet;
  import org.apache.poi.hssf.usermodel.HSSFWorkbook;
  import org.apache.poi.hssf.util.CellReference;
  import org.apache.poi.ss.usermodel.CellValue;
  import org.apache.poi.ss.usermodel.FormulaEvaluator;
  import org.apache.poi.ss.usermodel.Row;
  
  public class ExpressionExample {
  
      public static void main(String[] args) throws Exception {
  
          HSSFWorkbook workbook = new HSSFWorkbook();
          HSSFSheet sheet = workbook.createSheet("Sample sheet");
          Row row = sheet.createRow(0);
          FormulaEvaluator evaluator = workbook.getCreationHelper()
                  .createFormulaEvaluator();
          HSSFCell formulaCell = (HSSFCell) row.createCell(6);
          HSSFCell c1 = (HSSFCell) row.createCell(1);
          HSSFCell c2 = (HSSFCell) row.createCell(2);
          c1.setCellValue(5);
          c2.setCellValue(10);
          CellReference cr1 = new CellReference(0 , 1); 
  
          String line = "if(A1&gt;A2, \"LAR\" , if(5&gt;10, \"AB\" , \"CD\"))";
          formulaCell.setCellFormula(line);
  
          CellValue cellValue = evaluator.evaluate(formulaCell);
          System.out.println(cellValue.getStringValue());
      }
  
  }
  </code></pre>
  
  <p>now in my formula I have applied values of cells A1 and A2, but I want to give this value based on my code and cells should be 'C1 and c2. any Idea how to do this ?</p>
  
  <p>It would be great help.</p>