Multi Column Data Validation in Excel Table

TheFrog

New Member
Joined
Aug 4, 2009
Messages
11
Hi Everyone,

I have an Excel table. I am trying to perform a multi-column data validation. I am trying to use the COUNTIFS function like so:
=COUNTIFS([Supplier],C2,[Supplier_Code],D2)<=1

The goal is to ensure that the data entered is not a duplicate. The combination of [Supplier] and [Supplier_Code] is the basis of validation. The Supplier name is provided via data validation drop-down list in Column C, and the Supplier Code is entered (manually) into Column D.

When I use the formula in a calculated cell it works perfectly. When I try to use it as a data validation custom formula I receive an error: 'There's a problem with this formula........ Not trying to type a formula?......'. I have tried to get around this by using a helper column with the Supplier's name in it and applying the validation formula to both columns at the same time - no difference made, same error.

This is seemingly something I am not referencing properly when using the table to reference itself for the validation.

Can anyone steer me in the right direction?

Any help much appreciated.

Cheers

The Frog
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

mart37

Well-known Member
Joined
Aug 4, 2017
Messages
1,096
Office Version
  1. 2016
Platform
  1. Windows
Validation is an old function in Excel. It does not works with references you used.
Give the cells under the colum title a range name.
Use the range name in your validation formula.
 
Solution

mart37

Well-known Member
Joined
Aug 4, 2017
Messages
1,096
Office Version
  1. 2016
Platform
  1. Windows
Example: =COUNTIFS(Supplier,$C2,Supplier_code,$D2)<=1
 

TheFrog

New Member
Joined
Aug 4, 2009
Messages
11
Thanks for the feedback. I appreciate it.

I'll do the old style dynamic named ranges to overlap the table columns.

Cheers

The Frog
 

Forum statistics

Threads
1,143,687
Messages
5,720,298
Members
422,275
Latest member
Maria95

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
Top