how can i test to see if there are more than one objects with a tag C#

I have 4 objects with a trigger when all four objects (fourth is out of the frame)

i have a trigger around the cubes with this script.

using UnityEngine;
using System.Collections;

public class ColorDetector : MonoBehaviour 
{
	public GameObject Key;

	void OnTriggerEnter (Collider Keyz)
	{
		if (Keyz.gameObject.tag == "Yellow") 
		{
			if (Keyz.gameObject.tag == "Blue") 
			{
				if (Keyz.gameObject.tag == "Red") 
				{
					if (Keyz.gameObject.tag == "Green") 
					{
						Debug.Log ("IT Worked");
						Key.SetActive (true);
					}
				}
			}
		}	
	}
}

and the script does not set the key to active. thanks to all who can help.

This will work

public bool havekeyBlue = false;
public bool havekeyGreen = false;
public bool havekeyRed = false;
public bool havekeyYellow = false;
public GameObject me;

void Start()
{

}

void Update()
{

}
private void OnTriggerEnter(Collider collider)
{
    if (collider.CompareTag("BlueKey"))
    {
        havekeyBlue= true;
    }

    if (collider.CompareTag("GreenKEy"))
    {
        havekeyGreen = true;
    }
    if (collider.CompareTag("RedKey"))
    {
        havekeyRed = true;
    }
    if (collider.CompareTag("YellowKey"))
    {
        havekeyYellow = true;
    }
}

Is your debug.log coming out as “it worked”? If it isn’t you could handle the code like this. I’m not sure if this is the type of answer you were looking for but here you go.
using UnityEngine;
using System.Collections;

 public class ColorDetector : MonoBehaviour 
 {
     public GameObject Key;
     private int colorCounter = 0;

     void Update() {
            if (colorCounter = 4) {
                   //setactive blah
}
}
 
     void OnTriggerEnter (Collider Keyz)
     {
            if (your thing is green) {
                   colorCounter++;
            }
             if (your thing is red) {
                   colorCounter++;
            }
             // repeat for your colors
      }
      void OnTriggerExit (Collider Keyz) 
      {
            if (your thing is green) {
                  colorCounter--;
            }
            if (your thing is red) {
                  colorCounter--;
            }
//repeat for colors
}