automaticbaby
Technical User
I have a really long formula that works in an Excel spreadsheet, but I'd like to get it out of the cell due to people accidentally deleting it... continuously. I'd like the cell to only show the end result (yes/no). Is there a way to convert the formula to VBA?
Here's the formula (broken down to make it easier to read):
=IF(C2="","",
IF(ISNA(
INDEX(Price!$G$1:$G$3000,MATCH(C2&D2&E2,Prices!$C$1:$C$3000&Prices'!$D$1:$D$3000&Prices!$E$1:$E$3000,0))),
"no",
IF(B2="C",
IF(INDEX(Prices!$G$1:$G$3000,MATCH(C2&D2&E2,Prices!$C$1:$C$3000&Prices!$D$1:$D$3000&Prices!$E$1:$E$3000,0))<1,
"no",
"yes"),
IF(B2="P",
IF(INDEX(Prices!$H$1:$H$3000,MATCH(C2&D2&E2,Prices!$C$1:$C$3000&Prices!$D$1:$D$3000&Prices!$E$1:$E$3000,0))<1,
"no",
"yes")))))
Here's the formula (broken down to make it easier to read):
=IF(C2="","",
IF(ISNA(
INDEX(Price!$G$1:$G$3000,MATCH(C2&D2&E2,Prices!$C$1:$C$3000&Prices'!$D$1:$D$3000&Prices!$E$1:$E$3000,0))),
"no",
IF(B2="C",
IF(INDEX(Prices!$G$1:$G$3000,MATCH(C2&D2&E2,Prices!$C$1:$C$3000&Prices!$D$1:$D$3000&Prices!$E$1:$E$3000,0))<1,
"no",
"yes"),
IF(B2="P",
IF(INDEX(Prices!$H$1:$H$3000,MATCH(C2&D2&E2,Prices!$C$1:$C$3000&Prices!$D$1:$D$3000&Prices!$E$1:$E$3000,0))<1,
"no",
"yes")))))