ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need help with nested IF comparison.... (https://www.excelbanter.com/excel-programming/301208-need-help-nested-if-comparison.html)

Dan B

Need help with nested IF comparison....
 
Need some help with correct syntax...
I have 3 columns of data to compare. In the 2nd and 3rd columns, I want to
look for matching numbers. Where a match is found, I want to check for a 1
in the 1st column. If all that matches, I want to copy the matching number
in the 3rd column to a blank 4th column.

Basically, If B2 = any number in C2 thru C50, and A2=1 then copy B2 to D2.

I hope that makes sense.

Thanks



Tom Ogilvy

Need help with nested IF comparison....
 
if Range("A2").Value = 1 and _
Application.Countif(Range("C2:C50"), _
Range("B2").Value) 0 then
Range("D2").Value = Range("B2").Value
End If


for for a formula

=if(And(A2=1,countif(C2:C50,B2)0),B2,"")


--
Regards,
Tom Ogilvy

"Dan B" wrote in message
...
Need some help with correct syntax...
I have 3 columns of data to compare. In the 2nd and 3rd columns, I want

to
look for matching numbers. Where a match is found, I want to check for a

1
in the 1st column. If all that matches, I want to copy the matching

number
in the 3rd column to a blank 4th column.

Basically, If B2 = any number in C2 thru C50, and A2=1 then copy B2 to D2.

I hope that makes sense.

Thanks





JulieD

Need help with nested IF comparison....
 
Hi Dan

i think the following formula for D2 gives you what you're after
=IF(AND(COUNTIF($C$2:$C$50,B2),A2=1),B2,"")

Cheers
JulieD

"Dan B" wrote in message
...
Need some help with correct syntax...
I have 3 columns of data to compare. In the 2nd and 3rd columns, I want

to
look for matching numbers. Where a match is found, I want to check for a

1
in the 1st column. If all that matches, I want to copy the matching

number
in the 3rd column to a blank 4th column.

Basically, If B2 = any number in C2 thru C50, and A2=1 then copy B2 to D2.

I hope that makes sense.

Thanks





Frank Kabel

Need help with nested IF comparison....
 
Hi
try in D2:
=IF((COUNTIF($C$2:$C$50,B2))*(A2=1),B2,"")


--
Regards
Frank Kabel
Frankfurt, Germany


Dan B wrote:
Need some help with correct syntax...
I have 3 columns of data to compare. In the 2nd and 3rd columns, I
want to look for matching numbers. Where a match is found, I want to
check for a 1 in the 1st column. If all that matches, I want to copy
the matching number in the 3rd column to a blank 4th column.

Basically, If B2 = any number in C2 thru C50, and A2=1 then copy B2
to D2.

I hope that makes sense.

Thanks



Dan B

Need help with nested IF comparison....
 
These worked Great!
Thank you very much!!
Dan



"Dan B" wrote in message
...
Need some help with correct syntax...
I have 3 columns of data to compare. In the 2nd and 3rd columns, I want

to
look for matching numbers. Where a match is found, I want to check for a

1
in the 1st column. If all that matches, I want to copy the matching

number
in the 3rd column to a blank 4th column.

Basically, If B2 = any number in C2 thru C50, and A2=1 then copy B2 to D2.

I hope that makes sense.

Thanks






All times are GMT +1. The time now is 04:09 PM.

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