Difference between last column in a table and another column

Spiru

Board Regular
Joined
May 10, 2016
Messages
68
Hi guys,

Could you please help with any ideas with the below problem that I have?

I would like to calculate in the column where it says "Variance" the difference between last column where it finds values and the column before it (April -March). I have added in cell G1 a dropdown list (bold) with the months and I was thinking to use this cell in an If function..but I don't know how

April
JanuaryFebruaryMarchAprilMayJuneVariance
10325476
13437644

<tbody>
</tbody>


Thank a lot in advance
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Excel 2010
ABCDEFGHIJ
1anuaryFebruaryMarchAprilMayJuneVariance
21032547622
313437644-32
Sheet18
Cell Formulas
RangeFormula
J2=INDEX($A2:$F2,MATCH(9.99999999999999E+26,$A2:$F2,1))-INDEX($A2:$F2,MATCH(9.99999999999999E+26,$A2:$F2,1)-1)


If you want to choose which month then change the match lookup term to the cell reference, the match range to the months row section, and the type to 0.
 
Last edited:
Upvote 0
Thanks a lot it works! :) But I couldn't manage to change the formula in order to work with the month.
 
Upvote 0
the formula seems to work in some cells in my excel file but for my table it doesn't. In the table I have formulas witch populate the cells with numbers. I have tried to change the format in my columns to numbers, general, accounting or even text but the formula still doesn't work. Any idea why? Thanks a lot for your help
 
Upvote 0
it looks like the formula doesn't work because of the formulas that I have in column E (May)...although vlookup brings 0. Maybe using the month from the dropdown list like I said in my first post would make it work?
 
Last edited:
Upvote 0
This one goes by the month in I1:


Excel 2010
ABCDEFGHIJ
1JanuaryFebruaryMarchAprilMayJuneAprilVariance
21032547622
313437644-32
Sheet18
Cell Formulas
RangeFormula
J2=HLOOKUP($I$1,$A$1:$F$3,ROW(A2),0)-INDEX($A2:$F2,MATCH($I$1,$A$1:$F$1,0)-1)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,301
Members
449,078
Latest member
nonnakkong

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