Domanda

I have this text in an Excel cell in column A: 2 / 12 and want to make this subtraction in another cell in column B: =12-2.

For example, values in column A are:

2 /12
3 / 10
0 / l8
0 / 0 

and I want to do this subtraction in column B:

= 12-2
= 10-3
= 18-0
= 0-0

I want to appear only the results ex. 10, 7, 18, 0

How can I do this for multiple cells?

È stato utile?

Soluzione

Please try:

=RIGHT(A1,FIND("/",A1))-LEFT(A1,2)   

copied down to suit.

Altri suggerimenti

Excel has built in Text to columns feature that would probably be useful in this case.

  1. Under data
  2. click Text to columns
  3. selected Delimited
  4. Click Next
  5. Under Delimiters in "Other" enter "/" (without parenthesis) click finish.

That should give you 2 separate columns with your values you should then be able to easily subtract them in an adjacent cell.

This is a little weird for an excel file. I am going to make an assumption that your data in column A is formatted as "Text" because otherwise it would be calculating the value. I also assumed that there is a space between the numbers and the /. So with those assumptions in mind you could have this function in column B to get your result.

This example is for Row 1 of course but you simply copy down for the other rows accordingly

=(RIGHT(A1,LEN(A1)-FIND("/",A1)))-(LEFT(A1,FIND("/",A1)-1))

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top