PDA

View Full Version : Solved: Change a reference in a formula as you drag the formula from cell to cell



jbri
12-10-2009, 07:31 AM
The attached Excel file has a formula in columns E & F of the Analysis worksheet that gets information from various rows of the Rated8 worksheet. That is, every time a player finishes a gambling session detail of that session is added into the rated8 worksheet... the analysis worksheet searches for each entry of individual players and sums the collective result [I know the 'expert that will hopefully help with this thread can instantly tell this, but I am giving this explanation for those looking for a similar solution].

The attached file only has a few players (called A,B, C... to H), but the actual analysis workbook has a few thousand players.

The question is when you drag the formula down in columns E&F to the next row each reference name has to be manually changed to the corresponding name in column C. Most names in the real workbook are long and therefore it is not only time consuming (because there are a few thousand to change), but fraught with the potential to make typos that will stop the formula working.

Please, is there a way of incorporating such a change in the formula to do this or a VBA that will.

In anticipation of a solution, I thank you very much in advance.:bow:

Bob Phillips
12-10-2009, 07:52 AM
Try

=SUMIF(Rated8!$C$3:$C$342,D5,Rated8!D$3:D$342)

jbri
12-10-2009, 10:27 PM
Hi xld,

Thank you very much... a perfect solution that, not only worked but, when I read through the expression it made sense (I feel a bit guilty because I should have been able to see (with the skill level I have with Excel) that by changing the expression from a cell content reference - contained within my "" - to an absolute cell reference would have made the changes I needed when the formula was pulled from cell to cell).

Again thank you.:beerchug:

I have attached a corrected file for those wanting a starting point for a similar function.

Bob Phillips
12-11-2009, 03:15 AM
Note that I also changed the column reference in the range to be summed from absolute to relative so that it could be copied across to the next column with no manual change.