Need a little help with a simple operation.

Neomorpheus

New Member
Joined
Jul 11, 2018
Messages
5
Hello everyone,

I am trying to subtract from two cells that ends in MB, but cant find a way to do this.

Example:

Cell 1 value is 2000 MB, Cell 2 value is 1500 MB.

All i want to do is subtract from Cell 1 using Cell 2 value and return a result also using MB.

No matter what i have tried, i keep getting a #Value error.

Please advice and sorry, but I am a complete noob with Excel.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Im sure there is a better way but maybe something like this:

=TEXT(LEFT(A1, SEARCH( " ", A1)), "general")-TEXT(LEFT(B1, SEARCH(" ", B1)), "general") & " MB"
 
Upvote 0
Hi,

Assuming those are TEXT values in the two subject cells:


Book1
ABC
12000 MB1500 MB500 MB
Sheet131
Cell Formulas
RangeFormula
C1=LEFT(A1,FIND(" ",A1))-LEFT(B1,FIND(" ",B1))&" MB"
 
Upvote 0
Another way: Format cells 1 & 2 as; 0" MB"
when you enter 2000 or 1500 in those cells it will appear as 2000 MB and 1500 MB, but cell2 - cell1 will return 500, or if you format the cell holding the formula the same way it will show 500 MB.
 
Upvote 0
Hi,

Assuming those are TEXT values in the two subject cells:

ABC
12000 MB1500 MB500 MB

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet131

Worksheet Formulas
CellFormula
C1=LEFT(A1,FIND(" ",A1))-LEFT(B1,FIND(" ",B1))&" MB"

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Awesome, that did the trick!

Thank you!!!

one more question, can the result of that operation be converted to GB at the same time?

Meaning, adding "/1024" somewhere in it?
 
Upvote 0
Awesome, that did the trick!

Thank you!!!

one more question, can the result of that operation be converted to GB at the same time?

Meaning, adding "/1024" somewhere in it?

You're welcome.

Yes, if you want the result Rounded a certain way, let me know:


Book1
ABC
12000 MB1500 MB0.48828125 GB
Sheet131
Cell Formulas
RangeFormula
C1=(LEFT(A1,FIND(" ",A1))-LEFT(B1,FIND(" ",B1)))/1024&" GB"
 
Upvote 0
You're welcome.

Yes, if you want the result Rounded a certain way, let me know:

ABC
12000 MB1500 MB0.48828125 GB

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet131

Worksheet Formulas
CellFormula
C1=(LEFT(A1,FIND(" ",A1))-LEFT(B1,FIND(" ",B1)))/1024&" GB"

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Again, thanks!

Since i dont need the numbers to be that specific, i wouldnt mind not having any decimal points.

Sorry, really an Excel noob :(
 
Upvote 0
Again, thanks!

Since i dont need the numbers to be that specific, i wouldnt mind not having any decimal points.

Not sure what you mean by "any", because the result will be 0?

I've rounded it to 2 decimal points, change the 2 in the formula to what you want:


Book1
ABC
12000 MB1500 MB0.49 GB
Sheet131
Cell Formulas
RangeFormula
C1=ROUND((LEFT(A1,FIND(" ",A1))-LEFT(B1,FIND(" ",B1)))/1024,2)&" GB"
 
Upvote 0
You could also substitute the MB out of it:

=ROUND((SUBSTITUTE(A1,"MB","")-SUBSTITUTE(B1,"MB",""))/1024,2)&" GB"
 
Last edited:
Upvote 0
Not sure what you mean by "any", because the result will be 0?

I've rounded it to 2 decimal points, change the 2 in the formula to what you want:

ABC
12000 MB1500 MB0.49 GB

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet131

Worksheet Formulas
CellFormula
C1=ROUND((LEFT(A1,FIND(" ",A1))-LEFT(B1,FIND(" ",B1)))/1024,2)&" GB"

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Actually, that worked perfectly.

Again, thank you very much!!!!
 
Upvote 0

Forum statistics

Threads
1,215,608
Messages
6,125,820
Members
449,265
Latest member
TomasTeix

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top