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

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]April[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]January[/TD]
[TD]February[/TD]
[TD]March[/TD]
[TD]April[/TD]
[TD]May[/TD]
[TD]June[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Variance [/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]32[/TD]
[TD]54[/TD]
[TD]76[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]43[/TD]
[TD]76[/TD]
[TD]44[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Thank a lot in advance
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

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,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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