- Select the cells that contain the data you want to format.
- Right-click on the selected cells and choose "Format Cells" from the context menu.
- In the "Format Cells" dialog box, select the "Custom" category.
- In the "Type" field, enter the following format code:
Code:
0.00,, "GB";0.00, "MB";0.00, "KB";0.00, "B"
- Click "OK" to apply the formatting.
This format code will display the values in the cells as either
Gigabytes,
Megabytes,
Kilobytes, or
Bytes, depending on the size of the value. For example, a value of 500 MB will be displayed as
0.49 GB, and a value of 200 KB will be displayed as
0.00 GB.
Once you have formatted the cells, you can use Excel's built-in functions to add the values together. For example, to add 894 MB and 128 MB, you can use the following formula:
Assuming that the values are in cells A1 and A2, this formula will return a total of
1.02 GB.