 <p><strong>Steps, Using Apache POI :</strong></p> <ol> <li><p>Open excel file in input mode (inputstream)</p></li> <li><p>Use POI API and read the excel content</p></li> <li><p>Update cell’s value using different setCellValue methods.</p></li> <li><p>Close the excel input file (inputstream)</p></li> <li><p>Open same excel file in output mode (outputstream)</p></li> <li><p>Write content of updated workbook in output file</p></li> <li><p>Close output excel file</p></li> </ol> <p><strong>Sample:</strong></p> <pre><code>try { FileInputStream file = new FileInputStream(new File("C:\\update.xls")); HSSFWorkbook workbook = new HSSFWorkbook(file); HSSFSheet sheet = workbook.getSheetAt(0); Cell cell = null; //Update the value of cell cell = sheet.getRow(1).getCell(2); cell.setCellValue(cell.getNumericCellValue() * 2); cell = sheet.getRow(2).getCell(2); cell.setCellValue(cell.getNumericCellValue() * 2); cell = sheet.getRow(3).getCell(2); cell.setCellValue(cell.getNumericCellValue() * 2); file.close(); FileOutputStream outFile =new FileOutputStream(new File("C:\\update.xls")); workbook.write(outFile); outFile.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } </code></pre>