Convert Bytes to MB or GB in ExcelHere are two easy ways to convert bytes to MB or GB (and vice versa) in Excel

Written By:
Patrick Louie
Reviewed By:
FundsNet Staff

Bytes to MB (megabytes). Bytes to GB (gigabytes).

When you’re handling an excel sheet that deals with file size or storage space, you might be presented with data that are expressed in different units.

Some may be in bytes, while others may be in kilobytes, megabytes, or gigabytes.

Now, if you intend to use this data in calculations, you would want them to be uniform in units (e.g. all in bytes or megabytes).

Or maybe you just simply want to display the data in the same unit.

To do either, you would have to learn to convert between units.

How many bytes are there in a megabyte?

How about in a gigabyte?

You would also need to learn how to do the opposite (e.g. converting gigabytes or megabytes to bytes).

In this article, I will be showing you the different methods of converting between the different units of file size or storage space in Microsoft Excel.

The Bytes Conversion Chart

Before we work on converting bytes to megabytes or gigabytes in excel, let us familiarize ourselves first with how the units of file size or storage space work.

The smallest unit of data is a bit. However, files are rarely expressed in bits nowadays.

Rather, they’re expressed in bytes, KB (kilobytes), MB (megabytes), GB (gigabytes), TB (terabytes), and so on.

Every unit grows by 1024.

This means that 1024 bytes equal 1 KB.

Knowing this, we can say that:

  • 1024 bytes = 1 KB
  • 1024 KB = 1 MB
  • 1024 MB = 1 GB
  • 1024 GB = 1TB

And so on…

We can take this a step further and make a chart…

Basically, if we want to convert a smaller unit into a larger unit, we need to divide by multiples of 1024.

For example, if we want to convert bytes into kilobytes, we need to divide it by 1024.

If we want to convert bytes into megabytes, we need to divide it by 1024 * 1024 ( or 1,048,576 as per our chart above).

If we want to convert a larger unit to a smaller unit, we do the opposite.

Instead of dividing, we multiply in multiples of 1024.

For example, if we want to convert megabytes into bytes, we need to multiply it by 1024 * 1024 (or 1,048,576).

Converting Bytes to MB or GB in Excel (Using a Formula)

We can use the conversion chart above to make our formula in excel for converting between units of data (file size or storage space).

For example, let’s say we have the following data:

Converting Bytes to MB (Megabytes)

The data we have above is expressed in bytes.

We want to present the data in MB.

To do so, we will use an excel formula for converting bytes into MB:

 = CELL/(1024*1024)

For example, let’s say we want to convert the size of data A to MB. Here’s what it would look like:

And here’s what the file size is in MB:

Now let’s use the formula for the rest of the data.

Here’s how it should look after converting the file size to MB:

 

We can also express the formula in units of power. We could also use the POWER function:

=CELL/(1024^2)

Or

=CELL/POWER(1024,2)

Let’s try on using it on data A:

The result should still be 7,433.5 MB:

Converting MB (Megabytes) to Bytes

What if the data that we got was this:

The data is expressed in MB. We want to convert it to bytes. To do so, we will use the following formula:

=CELL*(1024*1024)

Let’s use this formula on data A:

Here’s the result:

Let’s apply the formula to the rest of the data.

Here’s how it would like converted to bytes:

We can also express the formula in units of power.

We could also use the POWER function:

=CELL*(1024^2)

Or

=CELL*POWER(1024,2)

Converting Bytes to GB (Gigabytes)

To convert bytes to GB, we need to divide it by 1024*1024*1024.

Expressing this into an Excel formula should look like this:

=CELL/(1024*1024*1024)

Let’s reuse the data above.

This time, we will be converting the data to GB:

Here’s the result:

Now let’s apply the formula to the rest of the data:

We can also express the formula in units of power.

We could also use the POWER function:

=CELL/(1024^3)

Or

=CELL/POWER(1024,3)

Let’s try using the POWER function:

The result should still be 7.3 GB:

Converting Bytes to GB (Gigabytes)

What if we had the following data:

The data is expressed in GB. We want to display it in bytes.

To do so, we will use the following formula:

=CELL*(1024*1024*1024)

Let’s try using it on data A:

And here’s the result:

Let’s apply the formula to the rest of the data:

We can also express the formula in units of power.

We could also use the POWER function:

=CELL*(1024^3)

Or

=CELL*POWER(1024,3)

Converting Bytes to MB or GB in Excel (Using a Formula)

Converting units of data is easy if we understand the conversion rate between the units.

Just remember that if we are converting a smaller unit into a larger unit (e.g. bytes to MB), we divide by multiples of 1024.

On the other hand, if we are converting a larger unit into a smaller unit (e.g. GB to bytes), we multiply in multiples of 1024.

Converting Bytes to MB or GB in Excel (Using the CONVERT Function)

Another way to convert units of data in Excel is to use the CONVERT function.

It’s particularly useful if you don’t memorize the conversion rates of different units, including units of data.

The formula for using the CONVERT function looks like this:

=CONVERT(CELL, “from_unit”, “to_unit”)

Where:

CELL = refers to the cell where the data you want to convert belongs to

“from_unit” = is the unit of measurement in which the selected data is currently expressed

“to_unit”= is the unit of measurement to which you want to convert the data

This formula allows us to convert one unit of measurement into another (e.g. bytes to megabytes, megabytes to gigabytes, etc.).

Although, we simply cannot use the terms “bytes” and “megabytes” for the function to work.

We have to use the fixed identifiers set by excel for it to work.

Here’s a table for reference:

Do note that the CONVERT function is case-sensitive.

It won’t function properly if the identifier isn’t in the correct case.

Also, the two units of measurement should be compatible.

For example, converting pounds (lbs.) into inches (in.) will not work.

Converting Bytes to MB or GB (and Vice Versa)

Now that we have the basic knowledge that we need to properly use the CONVERT function, let’s try using it.

We will be using this data (again) as our example:

First, let’s try expressing data A in MB:

And here’s the result (it should still be 7,443.5 MB):

And it is! Now let’s use the CONVERT function for the rest of the data:

Now let’s try converting data A into GB:

The result should still be 7.3 GB:

And we’re correct! Let’s apply the function to the rest of the data:

Now let’s try converting from a larger unit to a smaller unit (MB to bytes).

We will be using the following data:

Let’s try the CONVERT Function on data A:

And the result:

Using the CONVERT function to the rest of the data will result in this:

Using the CONVERT Function

As we can see, using the CONVERT function is very handy if we’re not familiar with the conversion rates between units.

However, we need to be aware of the syntax that we’re using.

The function only works if we’re using the right identifiers for the different units of measurement.

We also need to keep in mind that the function is case-sensitive.

Lastly, it would only work if the two units are compatible with each other.