Formula needed to return last instance/2nd to last instance...ect

NicholasP

Active Member
Joined
Nov 18, 2006
Messages
289
Hello,

I'm trying to find rolling percentage differences in my data. For instance, the difference between company A on 3/31 (15) and company A on 12/31 (10) is 50%. And the difference between company A on 3/31 (15) and company A on 9/30 (5) is 200%...

I know I can do this in VB, but was wondering what the formula solution might be.

I would really appreciate any assistance!
Thanks
Nick

Assuming 9/30 is in cell A1

9/30/2007 A 5
12/31/2007 B 1
12/31/2007 C 3
12/31/2007 A 10
3/31/2008 B 2
3/31/2008 C 6
3/31/2008 A 15


Also, sorry about not posting using the HTML maker, but I can't install it at work
 

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).

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
59,294
Office Version
  1. 365
Platform
  1. Windows
Is this what you mean? Note some #DIV/0! errors as 6 month data not available. I didn't try to clean this up because it's already a big enough formula and I'm not sure this is what you want anyway.

Note also my dates are in dd/mm/yyyy format.

Formula in G2 is copied across and down.

Excel Workbook
ABCDEFGH
130/09/2007A5Last dateCompany3 Months6 Months
231/12/2007B131/03/2008A50.00%200.00%
331/12/2007C3B100.00%#DIV/0!
431/12/2007A10C100.00%#DIV/0!
531/03/2008B2
631/03/2008C6
731/03/2008A15
8
Difference
 
Upvote 0

Yogi Anand

MrExcel MVP
Joined
Mar 12, 2002
Messages
11,454
Hi NicolasP:

following is one way ... with a single cell convoluted formula ...

<html><head><title>Excel Jeanie HTML</title></head><body>
Excel Workbook
ABCDE
130-Sep-07A5**
231-Dec-07B1A50%
331-Dec-07C3**
431-Dec-07A10**
531-Mar-08B2**
631-Mar-08C6**
731-Mar-08A15**
Sheet3 (2)


</body></html>
 
Upvote 0

NicholasP

Active Member
Joined
Nov 18, 2006
Messages
289
Thanks guys! That was very helpful! I ended up going with Peter's solution due to the way it fit into my spreadsheet. Thanks again!

~Nick
 
Upvote 0

Forum statistics

Threads
1,191,685
Messages
5,988,063
Members
440,125
Latest member
vincentchu2369

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
Top