I have a specific code that I am trying to copy from a .txt file and put into a row of 12 cells at the top of my worksheet. I can't seem to get this code to be accepted by a cell, starting at cell B3 (it just won't copy the whole formula, possibly because it's too long). Can someone please help me with figuring out to enter it into a cell? Also, if you see there is a more simplified formula to accomplish the same task, please let me know!

=IF(SUMPRODUCT(--(B$4:B$5="Sum of PxV 12")),$B$1,IF(SUMPRODUCT(--(B$4:B$5="Sum of VOL 12")),$B$2,IF(SUMPRODUCT(--(B$4:B$5="Sum of PxV 11")),$C$1,IF(SUMPRODUCT(--(B$4:B$5="Sum of VOL 11")),$C$2,IF(SUMPRODUCT(--(B$4:B$5="Sum of PxV 10")),$D$1,IF(SUMPRODUCT(--(B$4:B$5="Sum of VOL 10")),$D$2,IF(SUMPRODUCT(--(B$4:B$5="Sum of PxV 9")),$E$1,IF(SUMPRODUCT(--(B$4:B$5="Sum of VOL 9")),$E$2,IF(SUMPRODUCT(--(B$4:B$5="Sum of PxV 8")),$F$1,IF(SUMPRODUCT(--(B$4:B$5="Sum of VOL 8")),$F$2,IF(SUMPRODUCT(--(B$4:B$5="Sum of PxV 7")),$G$1,IF(SUMPRODUCT(--(B$4:B$5="Sum of VOL 7")),$G$2,IF(SUMPRODUCT(--(B$4:B$5="Sum of PxV 6")),$H$1,IF(SUMPRODUCT(--(B$4:B$5="Sum of VOL 6")),$H$2,IF(SUMPRODUCT(--(B$4:B$5="Sum of PxV 5")),$I$1,IF(SUMPRODUCT(--(B$4:B$5="Sum of VOL 5")),$I$2,IF(SUMPRODUCT(--(B$4:B$5="Sum of PxV 4")),$J$1,IF(SUMPRODUCT(--(B$4:B$5="Sum of VOL 4")),$J$2,IF(SUMPRODUCT(--(B$4:B$5="Sum of PxV 3")),$K$1,IF(SUMPRODUCT(--(B$4:B$5="Sum of VOL 3")),$K$2,IF(SUMPRODUCT(--(B$4:B$5="Sum of PxV 2")),$L$1,IF(SUMPRODUCT(--(B$4:B$5="Sum of VOL 2")),$L$2,IF(SUMPRODUCT(--(B$4:B$5="Sum of PxV 1")),$M$1,IF(SUMPRODUCT(--(B$4:B$5="Sum of VOL 1")),$M$2,""))))))))))))))))))))))))
Thanks in advance for your help!