Calculate cells based on the range of one item code and at the same time exclude the first row of that item code, or if possible base the formula on the color of the cells

I have a requirement to calculate the lowest price excluding zero, based on an inconsistent range of rows.  When calculating these rows I need to exclude the first row of each (grey row) from the range.   These scenarios as per the attached file, will occur in multiple workbooks.  I have to somehow calculate based on the range of one item code and at the same time exclude the first row of that item code, or if possible base the formula on the color of the cells.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rob HensonFinance AnalystCommented:
It's not clear from your example what you are trying to achieve.

Which column(s)/row(s) are you trying to calculate?

As a simple check, you could add a helper column with this formula, starting at row 2 and copied down:


This will give TRUE / FALSE as result, the first row of each set will be FALSE as they do not match the row above, you can then use the TRUE results as a criteria in your calculations.
Snappa2000Author Commented:

I am trying to calculate (in this example) cells range F2 to I2, F7 to I7 etc (the grey rows/blue columns)
If using a helper column, I don't know of a simple way of determining the range, could be 4 rows, could be 2 rows.

Rob HensonFinance AnalystCommented:
If you are using the product ID as one of the criteria of SUMIF/MAXIF/MINIF etc then you don't need to specify your range; you can just use the whole range down to the last row and let the product ID criteria determine which rows it needs to look at.

For example, if you implement the TRUE/FALSE indicator as suggested in column J:


That would only sum the TRUE from column J and the product ID in column B that match B2

Rob H

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Snappa2000Author Commented:
Thanks Rob
Had to use the MIN(IF but looks like it's giving me what I need.

Thanks again
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.