i'm just a little confused by some of the formulas you are using in the rows ....
BUT taking you at your word
you can use a countif() to see if the number is in the row
=IF(COUNTIF(AM3:BH3,BJ3)=0,BL3*-1,($AB3*$AA3)-BL3)
COUNTIF(AM3:BH3,BJ3)=0 , then the number is not in the row - and so BL3*-1
otherwise
($AB3*$AA3)-BL3
Now i have NOT fixed the ROW - so was not sure if
($AB3*$AA3)-BL3
was correct
but you can see the IF and change
I have also added conditional formatting
simple
AM3=$BJ3
BUT now with the line count, that gets a bit more complicated as that is changing a range based on a number in a different sheet
So the countif() will have to change
at the moment because in Linecount you have 22 we can use
COUNTIF(AM3:BH3,BJ3)=0
BUT if line count was 5 , then that would be
COUNTIF(AM3:AQ3,BJ3)=0
so i think we will need some sort of indirect() ... and columns / offset type of thing
will need to have a think about
if you could just check the $ in the formulas below
Book2 |
---|
|
---|
| AM | AN | AO | AP | AQ | AR | AS | AT | AU | AV | AW | AX | AY | AZ | BA | BB | BC | BD | BE | BF | BG | BH | BI | BJ | BK | BL | BM |
---|
2 | 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th | 10th | 11th | 12th | 13th | 14th | 15th | 16th | 17th | 18th | 19th | 20th | 21st | 22nd | | Actual | Colour | Investment | Profit/Loss |
---|
3 | 23.00 | 26.00 | 1.00 | 16.00 | 9.00 | 17.00 | 31.00 | 29.00 | 2.00 | 7.00 | 24.00 | 8.00 | 12.00 | 15.00 | 28.00 | 33.00 | 36.00 | 10.00 | 19.00 | 21.00 | 30.00 | 25.00 | | 14.00 | | 0 | 0 |
---|
4 | 23.00 | 26.00 | 1.00 | 16.00 | 9.00 | 17.00 | 31.00 | 29.00 | 2.00 | 7.00 | 24.00 | 8.00 | 12.00 | 15.00 | 28.00 | 33.00 | 36.00 | 25.00 | 4.00 | 11.00 | 10.00 | 20.00 | | 33.00 | | 0 | 0 |
---|
|
---|