ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel functions (https://www.excelbanter.com/excel-discussion-misc-queries/445721-excel-functions.html)

Matthew Williamson

Excel functions
 
I want to use the following IF ... THEN.

If any cell in column D contains x then put y in the same row in column G
and
If any cell in column D contains a then put b in the same row in column H

Can this be done?

Spencer101

Quote:

Originally Posted by Matthew Williamson (Post 1600632)
I want to use the following IF ... THEN.

If any cell in column D contains x then put y in the same row in column G
and
If any cell in column D contains a then put b in the same row in column H

Can this be done?

It would involve a formula in G and one in H.

In G1 put =IF(D1="X","Y","") and in H1 put =IF(D1="A","B","")then copy both formulas down as needed.

Matthew Williamson

Thank you. I had hoped there would be one instruction to analyse the column.

Don Guillett[_2_]

Excel functions
 
On Monday, April 9, 2012 7:25:39 AM UTC-5, Matthew Williamson wrote:
I want to use the following IF ... THEN.

If any cell in column D contains x then put y in the same row in column
G
and
If any cell in column D contains a then put b in the same row in column
H

Can this be done?




--
Matthew Williamson


Or use a worksheet_change event macro to make it automatic without any formulas. Right click sheet tabview codeinsert

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Or Target.Column < 4 Then Exit Sub
If UCase(Target) = "X" Then Target.Offset(, 3) = "Y"
If UCase(Target) = "A" Then Target.Offset(, 4) = "B"
End Sub


All times are GMT +1. The time now is 06:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com