gooniegirl180
Board Regular
- Joined
- Aug 13, 2003
- Messages
- 152
Hi folks, I have a number of tables that are used to create a number of different reports. I use a helper field in some of them to select and order which products are reported on - here is a sample of one of the formulas. This one is in row 10 and is copied down the column so that the cell references are not counting anything before the current row:
=IF(SUMIF([Sales Forecast Code],[@[Sales Forecast Code]],[Current Year Forecast])+SUMIF([Sales Forecast Code],[@[Sales Forecast Code]],[Current Year Actual])=0,"",IF([@[Item Group]]<>Selected_Product_Type,"",IF(COUNTIF($D$9:D10,D10)>1,"",MAX($T$8:T9)+1)))
where column D is the Sales Forecast Code and column T is the column this formula is in. The first row of data in the table is in row 9.
This basically weeds out any product that doesn't have any forecast or actual usage, and returns an index number (or a counter, if you like) for each unique Sales Forecast Code which I use to generate a report based on whatever Product Type a user selects. This means the index numbers change depending on the user's selection.
Because this formula is in a table, sometimes I get those pesky little green triangles because the COUNTIF and MAX cell references get themselves out of alignment. I do need those green triangles to tell me when it happens, so I don't want to eliminate them showing - I want to eliminate them occurring in the first place.
I suspect there is a more stable formula I could use to do the same thing, but I'm not knowledgeable enough to know what that is. Any help would be great, because at this point, I'm going to have to tell my users to fix any that come up, and I'd rather not do that.
Thanks,
GoonieGirl180
=IF(SUMIF([Sales Forecast Code],[@[Sales Forecast Code]],[Current Year Forecast])+SUMIF([Sales Forecast Code],[@[Sales Forecast Code]],[Current Year Actual])=0,"",IF([@[Item Group]]<>Selected_Product_Type,"",IF(COUNTIF($D$9:D10,D10)>1,"",MAX($T$8:T9)+1)))
where column D is the Sales Forecast Code and column T is the column this formula is in. The first row of data in the table is in row 9.
This basically weeds out any product that doesn't have any forecast or actual usage, and returns an index number (or a counter, if you like) for each unique Sales Forecast Code which I use to generate a report based on whatever Product Type a user selects. This means the index numbers change depending on the user's selection.
Because this formula is in a table, sometimes I get those pesky little green triangles because the COUNTIF and MAX cell references get themselves out of alignment. I do need those green triangles to tell me when it happens, so I don't want to eliminate them showing - I want to eliminate them occurring in the first place.
I suspect there is a more stable formula I could use to do the same thing, but I'm not knowledgeable enough to know what that is. Any help would be great, because at this point, I'm going to have to tell my users to fix any that come up, and I'd rather not do that.
Thanks,
GoonieGirl180