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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:45:47+00:00 2026-06-05T17:45:47+00:00

How do I check if a CELL in excel sheet is empty and doesn’t

  • 0

How do I check if a CELL in excel sheet is empty and doesn’t have any content inside it? I am traversing a row from left to right, and want to stop when I encounter an empty cell. I am using

 cell.getType()==CellType.EMPTY

but it doesn’t seem to work. Also,

if(cell.getContents() == "") is also not working.

What is the condition to check if the cell is a blank cell?

Thanks
Abhishek S

  • 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-05T17:45:48+00:00Added an answer on June 5, 2026 at 5:45 pm
        List cellDataList = new ArrayList();
    XSSFWorkbook workbook = new XSSFWorkbook(fileInputStream);
    
                            XSSFSheet sheet = workbook.getSheetAt(0);
    
                            Iterator rows = sheet.rowIterator();
    
                            int number=sheet.getLastRowNum();
    
    
                            int lineNumber = 0;
    
                            while (rows.hasNext())
    
                            {
                                XSSFRow row = ((XSSFRow) rows.next());
                                lineNumber++;
                                if(lineNumber==1){continue;}
    
    
    
    
                                Iterator cells = row.cellIterator();
                                List cellTempList = new ArrayList();    
                                int current = 0, next =1;
                                while(cells.hasNext())
    
                                {
    
                                    XSSFCell cell = (XSSFCell) cells.next();
    
    
                                    current = cell.getColumnIndex();
    
    
                                    if(current<next){
    
                                    }
                                    else{
    
                                        int loop = current-next;
    
                                        for(int k=0;k<loop+1;k++){
    
                                            cellTempList.add(null);
                                            next = next + 1;
                                        }
                                    }
                                    switch (cell.getCellType()) {
                                                case Cell.CELL_TYPE_STRING:
                                                    System.out.println(cell.getRichStringCellValue().getString());
                                                    cellTempList.add(cell.getRichStringCellValue().getString());
                                                    break;
                                                case Cell.CELL_TYPE_NUMERIC:                                                    
                                                        System.out.println(cell.getNumericCellValue());
                                                        cellTempList.add(String.valueOf(cell.getNumericCellValue()));                                                   
                                                    break;
                                                case Cell.CELL_TYPE_BOOLEAN:
                                                    System.out.println(cell.getBooleanCellValue());
                                                    break;
                                                case Cell.CELL_TYPE_FORMULA:
                                                    System.out.println(cell.getCellFormula());
                                                    cellTempList.add(cell.getCellFormula());
                                                    break;                                              
    
                                                default:
                                                    System.out.println("Inside default");
                                    }
                                    next = next + 1;
    
                                }
                                cellDataList.add(cellTempList); 
                             }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am reading the excel sheet from C# by using interop services. My sheet
I wanna check inserted value in excel cell and if value is higher than
I cant see any mention of how to check if current cell is last
I have to migrate document from MS Excel to Open Office with macros. Everything
I had tried check inside cell backgroundView, but for both styles (UITableViewStylePlain, UITableViewStyleGrouped) were
In Excel, I want to check if a specific cell for instance C12 has
I have a table and in every row I have a cell (Example, for
I have an Excel file that contains some values. I need to check if
I've used the top voted answer from here to check if a cell value
How do I use VBA in Excel to check if a below cell is

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.