If statement

ekhawaja

Board Regular
Joined
Dec 16, 2018
Messages
63
Office Version
  1. 365
Hello,

Looking for a formula that spits out the code as shown in col B if col A contains the specific number. Note that I have I have this data in thousands of rows. Thanks in advance.



1.1V-1
1.2V-1
2.1V-3
2.2V-3
2.3V-5
2.4V-4
2.5V-4
2.6V-3
4.0V-7
4.1V-9
4.2V-9
8.0V-8
9.1V-9
9.2V-9
9.3V-9
9.4V-9
9.5V-9
9.6V-9
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I think more explanation is necessary.

Are you saying that in the table above, you are trying to derive the second column from the first column?
If so, please explain the logic, because I am not seeing it.

Or, are you saying that is a "lookup" table, so whenever you look up a value like "4.2", you want it to return "V-9"?
If that is the case, you already have your lookup table above, and can just use a VLOOKUP formula.
See: VLOOKUP function - Microsoft Support
 
Upvote 0
hi @ekhawaja,
Another approach, assuming your list is static, can be done with two strings (in a macro) or cells (with formulas) with the same length:
"|1.1|1.2|2.1|...|9.6|", and "|V-1|V-1|V-3|...|V-9|"

Suppose you're using formulas and your list starts in column A and row 2.
Put the first and second strings in cells A1 (original) & B1 (result).
Now in B2, put this =mid($B$1,search($A$1, A2),3)
Then copy B2 to B3..B###
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,173
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top