# If cell contains text "A" or "B" then adjacent cell should give value "50" if it contains "A" or "60" if it contains "B"

#### martacar

##### New Member
Hey everyone,
I could really use your help.
I would like that column B automatically gives me either 50 or 60, depending if column A contains Q1 or Q2.
If it contains Q1 i would want them to give me as a result 1, if it contains Q2 i would like as a result 0,75, Q3 i would like to receive as a result 0,5 and Q4 i would like as a result 0,25.
Can anyone help! thanks a lot.

 A B Prorrata Q1 1 Prorrata Q2 0,75 Prorrata Q3 0,5 Prorrata Q4 0,25

<tbody>
</tbody>

### Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

#### Indystick

##### Board Regular
Your question is a bit confusing because the 3rd sentence seems to me to run counter to the fourth sentence. I went with what you have laid out in the table / fourth sentence:

Code:
``=IF(ISNUMBER(SEARCH("Q1",A1)),"1",IF(ISNUMBER(SEARCH("Q2",A1)),"0, 75",IF(ISNUMBER(SEARCH("Q3",A1)),"0, 5","0,25")))``

Last edited:

#### Yongle

##### Well-known Member
This is a simple formula and works with your simple sample data
BEWARE - it is only looking at the last character in the cell

Code:
``=CHOOSE(RIGHT(A2,1),1,0.75,0.5,0.25)``

Last edited:

Replies
9
Views
927
Replies
9
Views
459
Replies
5
Views
2K
Replies
4
Views
314
Replies
9
Views
566

1,186,732
Messages
5,959,432
Members
438,424
Latest member
TheHank

### 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.

### Which adblocker are you using?

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

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