Excel row count

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Excel row count

Post by VegasNath »

Out of sheer curiosity...

Prior to Excel 97 = 16384
Prior to Excel 2007 = 65536 (16384*4)
Excel 2007 = 1048576 (65536*16)

Why such strange numbers?
:wales: Nathan :uk:
There's no place like home.....

User avatar
HansV
Administrator
Posts: 78548
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Excel row count

Post by HansV »

Computers store everything in bits that can be off (0) or on (1). Hence they store numbers in binary format (i.e. base 2).
16,384 = 2^14 so numbers up to 16,384 fit in 14 bits.
65,536 = 2^16 so numbers up to 65,536 fit in 16 bits.
1,048,576 = 2^20 so numbers up to 1,048,576 fit in 20 bits.
Best wishes,
Hans

User avatar
HansV
Administrator
Posts: 78548
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Excel row count

Post by HansV »

And similar for the number of columns:

Excel 2003 and before: 256 columns = 2^8
Excel 2007: 16,384 columns = 2^16
Best wishes,
Hans

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Re: Excel row count

Post by VegasNath »

I can understand the need for > 1 million rows, though I can't ever imagine needing anywhere near 16 thousand columns. :flee:

Thanks for the explanation.
:wales: Nathan :uk:
There's no place like home.....

User avatar
HansV
Administrator
Posts: 78548
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Excel row count

Post by HansV »

I can't conceive the need for a million rows in Excel - if I have that much data I put it in a database. (And the argument "we don't have/use Access" doesn't make any sense - if you have that many data you need a database)
But although I can't conceive of the need for 16384 columns either, having more than 256 columns comes in handy once in a while: for example, if you want to create a (pivot) table with a column for every day of the year.
Best wishes,
Hans