public static HashMap<String, Integer> findRowIndexAndcolumnIndex(Sheet sheet, String cellContent) { HashMap<String, Integer> map = new HashMap<>(); for (Row row : sheet) { for (Cell cell : row) { if (cell.getCellType() == CellType.STRING) { if (cell.getRichStringCellValue().getString().trim().equals(cellContent)) { map.put("column",cell.getColumnIndex()); map.put("row",row.getRowNum()); return map; } } } } return map; }