IF Formula

daniels012

Well-known Member
Joined
Jan 13, 2005
Messages
5,219
Here is my formula:
Code:
=vlookup(1,X2:Z6,3,False)

I need to do this formula only if X2:X6 all have a different value. Is there a formula I can use to determine this?

Like if there are values:
X2=1
X3=1
X4=3
X5=4
X6=5
Then the formula would leave the cell blank.

If the value is:
X2=1
X3=2
X4=3
X5=4
X6=5
Then the formula would give the result of the Vlookup formula.

Thank You,
Michael
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Perhaps:

=IF(COUNTIF(X2:X6,"=1")>1,"",VLOOKUP(1,X2:Z6,3,FALSE))
 
Last edited:
Upvote 0
Here is my formula:
Code:
=vlookup(1,X2:Z6,3,False)

I need to do this formula only if X2:X6 all have a different value. Is there a formula I can use to determine this?

Like if there are values:
X2=1
X3=1
X4=3
X5=4
X6=5
Then the formula would leave the cell blank.

If the value is:
X2=1
X3=2
X4=3
X5=4
X6=5
Then the formula would give the result of the Vlookup formula.

Thank You,
Michael
Here's a generic method...

=IF(SUMPRODUCT((X2:X6<>"")/COUNTIF(X2:X6,X2:X6&""))=5,VLOOKUP(1,X2:Z6,3,0),"")
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,331
Members
452,907
Latest member
Roland Deschain

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