Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
GJP GJP is offline
external usenet poster
 
Posts: 2
Default Monthly Change Using Nested IFs?

I've got a spreadsheet that tracks a number of inventory categories & values
by month. The last column calculates the Monthly Change for each row - this
month's inventory minus last month's inventory. Rather than change the
formula each month I thought I could use a nested IF based on the month
number, but ran into the limitation of 7 nested IFs, which is a problem given
that there are 12 months. Anyone have a good way to do a subtraction
calculation in a cell that will have varying column references each month?
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default Monthly Change Using Nested IFs?

Gives an example of your current formula attempt.

--

"GJP" wrote in message
...
I've got a spreadsheet that tracks a number of inventory categories &
values
by month. The last column calculates the Monthly Change for each row -
this
month's inventory minus last month's inventory. Rather than change the
formula each month I thought I could use a nested IF based on the month
number, but ran into the limitation of 7 nested IFs, which is a problem
given
that there are 12 months. Anyone have a good way to do a subtraction
calculation in a cell that will have varying column references each month?
Thanks



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,345
Default Monthly Change Using Nested IFs?

Assuming the your sheet has each month's value in a the columns B:M then:

=LOOKUP(10^10,B2:M2)-INDEX(B2:M2,COUNT(B2:M2)-1)

or

=INDEX(B2:M2,COUNT(B2:M2))-INDEX(B2:M2,COUNT(B2:M2)-1)

will return the last value minus the second last value

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"GJP" wrote in message
...
I've got a spreadsheet that tracks a number of inventory categories &
values
by month. The last column calculates the Monthly Change for each row -
this
month's inventory minus last month's inventory. Rather than change the
formula each month I thought I could use a nested IF based on the month
number, but ran into the limitation of 7 nested IFs, which is a problem
given
that there are 12 months. Anyone have a good way to do a subtraction
calculation in a cell that will have varying column references each month?
Thanks



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Monthly Change Using Nested IFs?

You are probably lacking information here, but try this:
=LOOKUP(B1,{"Jan","Feb","Mar","Apr","May","Jun","J ul","Aug","Sep","Oct","Nov","Dec"})

Or perhaps this:
=OFFSET($A$1,,MATCH(B1,{"Jan","Feb","Mar","Apr","M ay","Jun","Jul","Aug","Sep","Oct","Nov","Dec"},0 ))

Regards,
Ryan--

--
RyGuy


"PCLIVE" wrote:

Gives an example of your current formula attempt.

--

"GJP" wrote in message
...
I've got a spreadsheet that tracks a number of inventory categories &
values
by month. The last column calculates the Monthly Change for each row -
this
month's inventory minus last month's inventory. Rather than change the
formula each month I thought I could use a nested IF based on the month
number, but ran into the limitation of 7 nested IFs, which is a problem
given
that there are 12 months. Anyone have a good way to do a subtraction
calculation in a cell that will have varying column references each month?
Thanks




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
GJP GJP is offline
external usenet poster
 
Posts: 2
Default Monthly Change Using Nested IFs?

Thanks to all for the assistance. After thinking about it some more I came
up with a solution that isn't too complex.

Each column has the month's text label. Under these labels I inserted the
integers 1 through 12. I then put in a box for the user to key in the
current month's integer. Right below the box is a formula that subtracts one
from the current month's integer.

To do the monthly change calculation, the formula is Hlookup(integer box
value,data table with the month's integer as the first row) - Hlookup(integer
box value - 1 cell,data table with the month's integer as the first row)

GJP

"Sandy Mann" wrote:

Assuming the your sheet has each month's value in a the columns B:M then:

=LOOKUP(10^10,B2:M2)-INDEX(B2:M2,COUNT(B2:M2)-1)

or

=INDEX(B2:M2,COUNT(B2:M2))-INDEX(B2:M2,COUNT(B2:M2)-1)

will return the last value minus the second last value

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"GJP" wrote in message
...
I've got a spreadsheet that tracks a number of inventory categories &
values
by month. The last column calculates the Monthly Change for each row -
this
month's inventory minus last month's inventory. Rather than change the
formula each month I thought I could use a nested IF based on the month
number, but ran into the limitation of 7 nested IFs, which is a problem
given
that there are 12 months. Anyone have a good way to do a subtraction
calculation in a cell that will have varying column references each month?
Thanks




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I change the IRR formula for MONTHLY periodic payments? Jon Excel Worksheet Functions 2 June 12th 06 10:58 PM
How do I set up monthly random work schedule for 60 hours monthly The Ace of the Base Excel Discussion (Misc queries) 0 April 4th 06 07:36 PM
non nested-if way to change (0) to 0? Ian Elliott Excel Discussion (Misc queries) 1 June 30th 05 12:09 AM
calculate monthly average percentage of change vikgarden Excel Worksheet Functions 2 April 15th 05 07:38 PM
Mortgage template comparing interest pd, monthly, bi-monthly, ext. JMC Excel Discussion (Misc queries) 0 April 14th 05 02:35 PM


All times are GMT +1. The time now is 03:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"