# Conditional Values

#### jdunkel

##### New Member
I am trying to write a conditional formula. There are 4 columns. Column A will reflects if type product has been selected on another tab. An X is put in the cell based on input from the other tab. Column C is a description of the product. Column B is a value based on the description (1, 2, 3, 4, etc). Column D is where I want to capture the value that corresponds with Column A and B in Column D. So if there is no "X" in column A row 1 then there would be no value from column C put in column D. If row 3 had an X then I want the value in column B (3) to be put in column D. I tried IF Fomula =IF(A78=X,"1",IF(A78=0," "). This would not work I got an error message. I tried VLookup and got more confused. How can create this formula.
A B C D
_ 1 term _
_ 2 UL _
x 3 SUL 3
_ 4 WL _

### Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
use "" on text

Code:
``=IF(A78="X","1",IF(A78=0," "))``

the second if clause is redundant in my opinion.

=IF(A78="X","1"," ")

should be enough.

sorry. Didn't read carefully enough. The content of column B is missing so far.

=IF(A78="X",B78,"")

Thank you. I have saved my brain. =IF(A1="X",B2," ") worked great. I have one more favor to ask. I need to extrapolate it one more level.

I want a formula similar to the last last scenario and want to use the lesser of the total in the results column. But only if there is a second person. So in the example below I want to have the final result pick the value (from column B or D, rows 1 through 4) that is smaller when comparing the results of the last formula and put it in the appropriate column (F). If is not on a row by row basis, it is based on the results of the 4 rows. I can live with just a total filed and not worry about if it lines up horizontally. The lesser number is only used when there is a 2nd person. I can use another field (outside of the fields below to determine if there is a 2nd person).

1st person 2nd person
A B C D E F

_ 1 X 1 Male age 74 or less/ Female age 77 or less 1
X 2 _ 2 Male age 75 - 78/ Female age 78 - 81 _
_ 3 _ 3 Male age 79 - 83/ Female age 82 - 86 _
_ 4 _ 4 Male age 84 +/ Female age 87 + _

Replies
3
Views
171
Replies
2
Views
145
Replies
15
Views
220
Replies
1
Views
70
Replies
1
Views
215

1,196,102
Messages
6,013,469
Members
441,767
Latest member
Craigh4444

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