Options

Excel feckwittery

2

Comments

  • Options

    *drools over excel thread*

    *adds to favs*

    image

  • Options

    =IF(ISNA(VLOOKUP(....etc)),"",VLOOKUP(....etc))

    image

    So, my lesson for today: dynamic ranges.

    You know how you can select a block of data and give it a name? No? well that's a different lesson.

    Well these named ranges can be very useful for lots of things - I'll use pivot tables as an example. When asked the question "Where is the data that you want to use?", you can either select some data and it fills out the cell references e.g. 'Sheet 1'!$A$1: $G$100' or you could call that block of data something useful like 'PivotData' and just type 'PivotData' into the Range box.

    That's great if your data is always exactly 100 rows and never more or less than 7 columns. But what if you add new rows all the time (or delete some) or if you add more columns that you might want to put in your pivot report? I've seen a lot of examples of incorrect reports because someone did a pivot table based on 100 rows of data when there were actually 150 rows due to things being added after the pivot table was created.

    "Aha", you cry, because you like Norweigan 80s pop bands. "I could just select the whole sheet and tell Excel to base my pivot table on thousnads more rows than I actually need". Yes, you could - and you'd find that your file is suddenly massive. And your pivot table will have a field called 'blank'.

    The clever solution is a dynamic range. This is a named range that changes as you add or delete data from it. Using the example above of a sheet where we have data in columns A to G and rows 1 to 100, you could select that, go to 'Insert -> Name ->' on the menu, call it PivotData and press OK. But the fiendishly clever bit is to do the above but stop before pressing OK. Then in the 'Refers to:' box at the bottom of the 'Define Name' screen, type this:

    =OFFSET(A1,0,0,COUNTA(A:A),COUNTA(1:1))

    Press Add, then OK, and you have a dynamic range. Now if you add another row your PivotData range will expand to include it, and your pivot table will never again be missing data (as long as you remember to refresh it).

    It's a neat trick that I also often use for validation lists, e.g. I have a cell on one sheet with a drop down list of options that comes from a range on another sheet. If I make it a dynamic range I can add new options to the list and the drop down will pick them up.

    Here endeth today's lesson.

  • Options
    Curly45Curly45 ✭✭✭
    Oooooo me likey...sadly I dont get much data for pivot table use (might have to invent something to use it on now image)
  • Options
    Hey, who needs a use for it? Just create a dynamic range for the sheer fun of it! image
  • Options
    I should add a warning that the example above assumes that you have no blank cells in the middle of your data in column A or row 1 (blank cells in a block of data are bad). If you do, just change the column or row reference to one that will always have data for every cell.
  • Options

    Excel childcare:

    =IF(CRYING,IF(SMELLY,CHANGE,FEED),"")

  • Options
    image OMG I love this thread
  • Options

    Today, SUMPRODUCT.

    Say you have a column of prices and a column of quantites, and you want to calculate the total value. With prices in A1:A10 and quantities in B1:B10:

    =SUMPRODUCT(A1:A10,B1:B10)

    And bingo, you've got the sum of A1 x B1, A2 x B2  etc in a single cell. What if there are some rows that you don't want to include in your total? Easy, just put 1 in column C against the ones you want to include, 0 against the ones you don't want, and:

    =SUMPRODUCT(A1:A10,B1:B10,C1:C10)

    image

  • Options

    image *scribbles in her note book*

    *hands SVT another apple*

  • Options

    This is the only place I can say this without getting banished off the forum BUT...

    For my tri training plan, I have two worksheets set up that look up the week I am on, the type of training done ie bike, swim or run and then calculates the percentage of time I have (or not) spent running, cycling and swimming. It  is all fairly easy sum/if calcs but it works very well imageimage

  • Options

    I love it when race results are published in Excel format, particularly tri results. The analysis is endless.

    A standard calc is seeing what percentage of time I spent on each discipline compared to the average, to all senior men, other pirates etc. Hours of fun!

  • Options
    NessieNessie ✭✭✭
  • Options

    OMG I just luuurrrrv this thread imageimageimage

    I'm an accountant image

  • Options
    Curly45Curly45 ✭✭✭
    SVT - dont forget the hours of fun you can have on Po10 as well...wish they'd do the rankings in full excel though *sigh*
  • Options
    NessieNessie ✭✭✭
  • Options

    Curly - Po10?

    (Anything that involves Excel and hours of fun sounds good to me.)

    I'm quite fond of my weight loss tracker with (no pun intended) weighted average projection of future weight. Looks good on a chart.

  • Options

    Accountant, formerly programmer.

    imageimage

  • Options
    Curly45Curly45 ✭✭✭

    http://www.thepowerof10.info/

    Rankings, Running, Results = heaven

    There is hours of fun to be had on here then comparing your compariots from a race with their usual times etc...

  • Options

    *cough* Excuse me bursting in like this

    I'm filling in a spreadsheet and when I put the telephone number in it loses the first 0, I know its possible to stop this but can't remember how.

    Thank you please

    I'll pack a few parcels and come back to check in a mo

  • Options
    format, cell, then click on text on the number tab image
  • Options
    Curly45Curly45 ✭✭✭
    You can put a ' in front of the number or space the number out like 0044 20 xxx xxx then it realises it is a phone number rather than a 'number' - I think the latter only works on newer excels though - maybe one of the super nerds can confirm image
  • Options

    Thanks Shimmy, I knew that really just use Spreadsheets so rarely imageimage

    Curly, I did it Shimmy's way but thanks anyway image

  • Options

    I'll try out that method next time I do a phone number thing Curly.  Not come across that before.

    HTH Beebs image

  • Options

    I always do the ' for making numbers into text.

    To turn a number formatted as text back into a number, just multiply it by 1.

  • Options
    M..o.useM..o.use ✭✭✭

    I would like to freeze my top line as it has all the headers.  If I highlight the row and then do 'freeze pane' it seems to want to freeze the top 10 lines.

    Pwease help.

    *puppy dog eyes*

  • Options

    M.ouse - try selecting a cell in row 2 and then freeze panes. That would normally work.

  • Options
    Put the cursor into cell A2 and then try again. Right now, Excel is just guessing where to freeze.
  • Options
    Pipped at the post image
  • Options
    M..o.useM..o.use ✭✭✭
Sign In or Register to comment.