Contar celdas en función del color de relleno en Excel

%3CLINGO-SUB%20id%3D%22lingo-sub-1983431%22%20slang%3D%22es-ES%22%3ECount%20cells%20based%20on%20fill%20color%20in%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1983431%22%20slang%3D%22es-ES%22%3E%3CP%3EGood%20to%20all%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22x-hidden-focus%22%3EI'm%20going%20crazy%20because%20I%20want%20you%20to%20tell%20me%20the%20number%20of%20squares%20that%20have%20one%20color%20and%20another%2C%20but%20I%20can't%20find%20the%20formula.%20I%20know%20how%20to%20change%20the%20background%20color%20based%20on%20the%20data%2C%20but%20I%20want%20just%20the%20opposite.%3C%2FP%3E%3CP%20class%3D%22x-hidden-focus%22%3EI'd%20like%20you%20to%20count%20the%20green%20cells%20and%20add%201%20and%20the%20ones%20that%20are%20red%20don't%20add%20anything%20up%20(or%20add%200).%20Could%20someone%20help%20me%20with%20this%20formula%3F%3C%2FP%3E%3CP%20class%3D%22x-hidden-focus%22%3EAttached%20image%20of%20what%20I%20intend%20for%20more%20info.%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3EI%20tried%20to%20follow%20the%20steps%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fes-es%2Fprevious-versions%2Foffice%2Ftroubleshoot%2Foffice-developer%2Fcount-cells-number-with-color-using-vba%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Eof%20this%3C%2FA%3Ethread%2C%20but%20when%20selecting%20the%20criterion%20cell%20and%20giving%20intro%20gives%20me%20formula%20error.%3C%2FP%3E%3CP%3EThank%20you%20in%20advance.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1983431%22%20slang%3D%22es-ES%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1983458%22%20slang%3D%22en-US%22%3ERe%3A%20Contar%20celdas%20en%20funci%C3%B3n%20del%20color%20de%20relleno%20en%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1983458%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F900370%22%20target%3D%22_blank%22%3E%40javihop%3C%2FA%3E%26nbsp%3BRather%20than%20explaining%20in%20words%20and%20repeating%20all%20the%20instructions%20in%20the%20link%20you%20found%20yourself%2C%20please%20see%20the%20attached%20file.%20It%20has%20the%20exact%20same%20code%20in%20it%20and%20an%20example%20of%20how%20to%20use%20it.%20Note%20that%20the%20%22criteria%22%20cell%20must%20have%20the%20same%20colour%20for%20a%20correct%20answer%20as%20in%20the%20cell%20ranges%20you%20want%20to%20check.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Buenas a todos:

 

Me estoy volviendo loco porque quiero que me cuente el número de casillas que tienen un color y de otro, pero no no encuentro la fórmula. Sé cómo se cambia el color de fondo en función de los datos, pero quiero justo lo opuesto.

Me gustaría que contara las celdas que hay de color verde y sumanara 1 y las que están de color rojo no sume nada ( o sume 0). ¿Alguien podría ayudarme con esta fórmula?

Adjunto imagen de lo que pretendo para más info.

 

He intentado seguir los pasos de este hilo, pero a la hora de seleccionar la celda de criterio y darle a intro me da error de fórmula.

Gracias de antemano.

1 Reply

@javihop Rather than explaining in words and repeating all the instructions in the link you found yourself, please see the attached file. It has the exact same code in it and an example of how to use it. Note that the "criteria" cell must have the same colour for a correct answer as in the cell ranges you want to check.