question

kdinuk avatar image
kdinuk asked

Excel vlookup formulaes to SQL

IF I consider 'PREVMNTPV' is one table and 'CURR' is other table and 'CURR' table consists of field1,field2,fied3 and field4. How do I get the below excel formaules to SQL. Please help me out... col1/field1=IF(T2="Inactive",0,IF(AND(ISNA(VLOOKUP($A2,'PREVMNTPV'!A:B,2,FALSE)),BL2=1),1,IF(ISNA(VLOOKUP($A2,'PREVMNTPV'!A:B,2,FALSE)),0,IF(AND(BL2=1,VLOOKUP($A2,'PREVMNTPV'!A:E,5,FALSE)="Inactive",T2="Active"),1,IF(ISNA(VLOOKUP($A2,'PREVMNTPV'!A:B,2,FALSE)),0,IF(AND(BL2=1,VLOOKUP($A2,'PREVMNTPV'!A:F,6,FALSE)=0),1,0)))))) col2/field2=IF(ISNA(VLOOKUP($A2,'PREVMNTPV'!A:B,2,FALSE)),0,IF(AND(T2="Inactive",VLOOKUP($A2,'PREVMNTPV'!A:K,6,FALSE)=1,VLOOKUP($A2,'PREVMNTPV'!A:E,5,FALSE)="Active"),-1,IF(AND(VLOOKUP($A2,'PREVMNTPV'!A:K,6,FALSE)=1,BL2=0,VLOOKUP($A2,'PREVMNTPV'!A:E,5,FALSE)="Inactive"),0,IF(AND(BL2=0,VLOOKUP($A2,'PREVMNTPV'!A:K,6,FALSE)=1),-1,0)))) col3/field3=IF(OR(T2="Inactive",DI2<0),0,IF(DG2=-1,0,IF(DF2=1,BT2,IF(ISNA(VLOOKUP(A2,'PREVMNTPV'!A:K,8,FALSE)),BT2,IF(AND(BL2=1,(VLOOKUP(A2,'PREVMNTPV'!A:K,8,FALSE)0),0,BT2-(VLOOKUP($A2,'PREVMNTPV'!A:K,8,FALSE)))))))
sqlexcel
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.