I am trying to construct a SQL INSERT statement from some data in an Excel spreadsheet. Here is some sample data:
ORIGINAL | DESIRED OUTPUT
ND 0, null
0.23 0.23, null
0.45 J 0.45, 1
0.99 B 0.99, 2
So the rules would be:
I can create individual rules without too much trouble, but I can't seem to string them together. For example:
=IF(A1="ND","0, null",A1)
The above will take care of the first instance of 'ND', but not sure how to add in the other rules.
Please try:
=IF(A1="ND","0, null",IF(RIGHT(A1)="J",LEFT(A1,LEN(A1)-2)&", 1",IF(RIGHT(A1)="B",LEFT(A1,LEN(A1)-2)&", "&2,A1&", null")))