I was trying to search for if this was possible, but I wasn't exactly sure what it would be called, so I thought that I'd post here.
I have a table with 10 rows (different programs) and 12 columns (different months). The table is for keeping track of an amount spent.
I would like to be able to create another column that finds the percentage for the amount spent/total originally available.
However, I don't want to create a whole table to calculate the values. I only want one column of percentage values.
I would like a formula to automatically calculate the percentage of each row, only for the most recent month.
For example, now I want it to calculate the November percentages, and next month when I input the December data, I want it to change to calculate the December percentages, without me having to redo the formulas.
How can this be done? I think it should be possible, but it is way beyond my excel knowledge.
Thaank youu!
Hi,
You can do this using the OFFSET function.
For example, where there is a list of data in column A starting in A1, use this
=OFFSET(A1,COUNTA(A:A)-1,0)
to return the last cell in the column.
Please disregard anything in the above post. It may well have been edited without my consent, as has been the case with several posts and threads recently.
I'm trying to figure out the offset function, and maybe I'm not understanding it correctly, but it seems that it just copies a cell and puts it in a different place?
I will give a more detailed example of what I am trying to do (the formatting is bad, but think of it as an excel looking file):
The info I have in my excel:
Totals for the year:
Program 1: 100
Program 2: 150
Program 3: 125
Amount Spent (What input would look like at the end of November)
October November December January
Program 1: 10 15
Program 2: 15 30
Program 3: 10 20
Amount Spent (What input would look like at the end of January)
October November December January
Program 1: 10 15 20 30
Program 2: 15 30 45 50
Program 3: 10 20 25 35
What I am want to figure out how to do:
(amount spent/total)
After November is input I want to see:
Program 1: 10% (10/100)
Program 2: 10% (15/150)
Program 3: 8% (10/125 )
After January is input I want to see:
Program 1: 30% (30/100)
Program 2: 33.3% (50/150)
Program 3: 28% (35/125 )
I know how to have it automatically calculate based on a cell, but I would like to be able to change the cell it is calculated from without having to manually input it.
EX. have it go from calculating C3/B10, C4/B11, C5/B12 to calculating E3/B10, E4/B11, E5/B12
I am thinking that it would know which column to use based on what is filled in. It would take the column furthest to the right that is filled in.
Is offset the right formula tool to do this?
Last edited by dunCar; 11-30-2009 at 04:06 PM.
See if the attached is what you intended.
Palmetto
Do you know . . . ?
You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.
Maybe????
dunCar.xls
The OFFSET function returns the contents of a cell offset by a number of rows and columns. By combining the offset function with the COUNT or COUNTA function it is possible to obtain the value in the final cell in a row or column, as per the example above.
Please disregard anything in the above post. It may well have been edited without my consent, as has been the case with several posts and threads recently.
I would suggest using LOOKUP given it is neither Volatile nor susceptible to blank data points, ie
=LOOKUP(9.99999999999999E+307,$E2:$P2)
would give you the last numeric value entered in range E2:P2
In short were it me I would adopt khamilton's earlier example.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Hurray! It worked!
Ok, I've finally had time to look through these responses, and I definitely learned a TON about excel from everyone who responded. I feel like an expert now.lol
I decided to use the Lookup suggestion, as I understood it more easily, and I think that I can fix it more easily if I mess up...lol... but it seems that they both would have worked.
Here is the final equation that made it work for me:
=IF(LOOKUP(9.99999999999999E+307,D74:O74)=0,0%,LOOKUP(9.99999999999999E+307,D74:O74)/(LOOKUP(9.99999999999999E+307,D31:O31)))
If the latest cell is a 0, put 0%. If not, look up the latest amount spent and divide by the latest amount authorized.
YAY!
Thank you all!
Shouldn't the first lookup be referencing D31:O31 rather than D74:O74... given the latter is the divisor
(ie if row 31 returned 0 the subsequent division would generate #DIV/0! whereas if row 31 was not 0 and row 74 was zero the output would simply be 0% anyway)
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks