Hi,
Is it possible to use the below formula, but for it to not include rows that a certain colour?
=SUMPRODUCT(--($H$2:$H$65536=2),--($Y$2:$Y$65536=7),$AA$2:$AA$65536)/100
Hi,
Is it possible to use the below formula, but for it to not include rows that a certain colour?
=SUMPRODUCT(--($H$2:$H$65536=2),--($Y$2:$Y$65536=7),$AA$2:$AA$65536)/100
Is the colour being set manually or by conditional formatting?
Ernest
Please consider adding a * if I helped
Nothing drives me crazy - I'm always close enough to walk....
Hi Judge it will be manually,
Background: it is a file of test transactions, if there is a voided line in a transaction it will appear in say Y1 and Y2 with the same value, X1 will be a plus and X2 a minus. So would like to ignore these. But as they are two in rows SUMProduct cant account for this.
okay....that makes it a bit more difficult....if it was done using CF you could have incorporated the same logic in an IF statement that was used in the CF logic....somebody in this forum wrote a UDF that told you if a cell was coloured....so if you can find that, you can use it in an IF statement....IE: IF(Coloured, Do SUMPRODUCT, DoNothing)....let me know if you can't find it....maybe I can...
I found this and added it in, can now see as a UDF
Http://www.ozgrid.com/VBA/ReturnCellColor.htm
not quite sure how to amend formula though.
Think this may be better
<Code>
Function Filled(MyCell As Range)
If MyCell.Interior.ColorIndex > 0 Then
Result = 1
Else
Result = ""
End If
Filled = Result
<\Code>
End Function
by the way your [\code] should be [/code].....I did that the other day too....
looks a lot easier....do you need help on the formula to incorporate that with your SUMPRODUCT?
Yeah, soon as I hit enter I realised that, spend most day looking at xml too :S
Yes I wouldnt mind....
So I would change the function to return a 0 (that's a zero) instead of a ""....then try something like this...
=IF(Filled(A1),SUMPRODUCT(),"")......in english....if the cell colour in A1 is anything but white do SUMPRODUCT else fill in the field with a blank (or anything else you want to the cell to display)...
Sorry to keep on, but when I do this
=IF(Filled(AA7),"yes","no") i get a yes if filled but if not i get #value! - any ideas?
wait....do you set the function return value for "" to a zero?
IE:
![]()
Function Filled(MyCell As Range) If MyCell.Interior.ColorIndex > 0 Then Result = 1 Else Result = 0 End If Filled = Result
not without see the file...can you upload the file?
Sorry, I have now, so that is all working great
Just need to figure out how to combine with the SUMPRODUCT, missing out the rows that are coloured
sweeeeeeeeeeet.....glad it worked out....
remember to set the thread/post to solved if this fixed your issue....
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks