how can I subtract excel cell values that contain both a number a.

G

Guest

I have measurement data from an ATE system where the results are given as
both a number and 'unit' letters for example 22.3 dB, 2.109 MHz, 12.06 V and
0.175 A. To calculate temperature drift from these readings, I need to
subtract cells that contain both a number and a letter i.e.

2.012 MHz - 2.005 MHz = 0.007
does not matter if the answer contains the 'units' or not.

anyone know how I can achieve this ?
 
G

Guest

John,

Assuming there is a space between the value and the suffix, you could strip
the numeric value out of a cell this:

=LEFT(M30,FIND(" ",M30))

This will return all the characters in the string in M30 up to the space -
this should be your numbers. You could then use this idea to subtract the
numeric elements of two cells from each other thus:

=LEFT(M30,FIND(" ",M30))-LEFT(M31,FIND(" ",M31))

Hope this helps - unledd there isn't a space between the number and the
suffix, in which case I'll have to think again!

Cheers

Pete
 
G

Guest

John,

Re: my last answer, just to be sure, you need to subtract 1 when you've
found your space - thuis, if the space occurs at the fourth position, you
only want to see the first 3 characters, and so on. This version also adds
the appropriate suffix onto the end of your formula. Wish I'd thought of it
first time round!

=LEFT(M30,FIND(" ",M30)-1)-LEFT(M31,FIND(" ",M31)-1)&" Mhz"

Pete
 
G

Guest

John,

This was a GOOD problem!

This final version strips the suffix from M30 and adds it, prefixed by a
space, to your answer.

=LEFT(M30,FIND(" ",M30)-1)-LEFT(M31,FIND(" ",M31)-1)&"
"&RIGHT(M30,LEN(M30)-FIND(" ",M30))

I'll go away now.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top