How to calculate the difference between numbers

faizzsheikh

New Member
Joined
May 10, 2013
Messages
19
What formula should I use to calculate the difference between the two values.

Eg.

Note - By applying the formula =A1-B1 or =B1-A1 I get wrong ans for some instances

1st May____8th May____Difference
20_________25________-5
25_________20________5
0__________20________20
20_________0_________-20

Must return the above value under 'Difference'

I have a large amount of similar data
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
No this does not work...

The below formula worked for me. Someone helped me out with it. It was very complicated.
=IF(OR(A1=0,B1=0),B1-A1,A1-B1)


Keyword Rank__________Person Name
1_____________John
5_____________Agnes
8_____________Agnes
12____________John
20____________Agnes
13____________Agnes
3_____________John
40____________John
8_____________John
15____________Agnes
10____________John


I want to count the the numbers that John has between 1 to 10 only. In the above case John must have 4 Keyword Ran between 1 to 10

Please help!


Thanks in advance
Faiz
 
Upvote 0
With numbers in A and names in B, here's one formula you could try:

=SUMPRODUCT((A1:A10>=1)*(A1:A10<=10),--(B1:B10="John")

If you're using Excel 2007 or newer, look at the COUNTIFS function.
 
Upvote 0
Thanks a lot Ben! It worked :)
I will have to improve my mathematical logic to be able to do it myself.

Thanks again!
Faiz
 
Upvote 0
No problem ... Glad I could help (y) Appreciate the feedback!
 
Upvote 0

Forum statistics

Threads
1,215,949
Messages
6,127,877
Members
449,410
Latest member
adunn_23

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