Home » excel » How do you divide two cells in Excel that have numbers and text in them?

How do you divide two cells in Excel that have numbers and text in them?

Posted by: admin May 14, 2020 Leave a comment

Questions:

I have two cells that both have text and numbers in them from a ‘COUNTIFS’ formula. Such as:

Number of X: 4

Total Number of X: 10

How do I divide the two outputted numbers together two calculate a percentage?

How to&Answers:

You’ll have to use string manipulation here. Assuming your supplied values are in A1 and B1, respectively, you can use:

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

Which isn’t pretty, but neither is your data.

This will output 0.4 which you can format into a percentage or multiple by 100 or whatever suits your downstream needs.

Answer:

Use Custom Formats:

enter image description here

Then only the number is stored and you can do simple math:

=C3/C2

enter image description here