Suppose I have data as follows,

```
data

required_value          Value1          Value2        Value3
     0.5                  .1              0.3           0.4
     1.0                   1              0.7           0.2
     1.5                  .37             0.3           0.7
     2.0                  1.25            0.9           1.9

```

I want to find which of the three columns(Value1, Value2, Value3) are closest to the required value and create a new column and have the columnname of the column. My sample output is,

data

```
required_value          Value1          Value2        Value3       output
     0.5                  .1              0.3           0.4        Value3
     1.0                   1              0.7           0.2        Value1
     1.5                  .37             0.3           0.7        Value3
     2.0                  1.25            0.9           1.9        Value3

```

I am able to find the closet value in this. But not able to get the corresponding column name. Can anybody help me in doing this?

Thanks