Excel conditional format or formula help
Closed
                                    
                        jen                    
                                    -
                            Nov  1, 2011 at 04:10 PM
                        
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Nov 2, 2011 at 12:13 AM
        venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Nov 2, 2011 at 12:13 AM
        Related:         
- Excel conditional format or formula help
 - Number to words in excel formula - Guide
 - Date formula in excel dd/mm/yyyy - Guide
 - Excel color formula - Guide
 - Formula to calculate vat in excel - Guide
 - Excel mod apk for pc - Download - Spreadsheets
 
1 response
                
        
                    venkat1926
    
        
                    Posts
            
                
            1863
                
                            Registration date
            Sunday June 14, 2009
                            Status
            Contributor
                            Last seen
            August  7, 2021
            
            
                    811
    
    
                    
Nov 2, 2011 at 12:13 AM
    Nov 2, 2011 at 12:13 AM
                        
                    in excel 2003 or earlier versions conditional formatting (format-conditionaformatting) can work on only three conditions.  so a macro is required.
I do not know whether by a formula you can color a cell.
so if you want to put a number in colulmn C then you can do it
suppose the data is as follows from A1
1 62
9 76
3 43
10 71
3 70
8 96
2 52
1 93
9 64
1 74
then in C1 copy this formula
=IF(AND(A1>=2,B1>=80),2,IF(AND(A1>=2,B1<80),1,IF(AND(A1<2,B1>=80),1,IF(AND(A1<2,B1>=80),0,""))))
copy C1 down
if you are interested only in color run this macro
keep the sheet as active sheet and run the macro
            I do not know whether by a formula you can color a cell.
so if you want to put a number in colulmn C then you can do it
suppose the data is as follows from A1
1 62
9 76
3 43
10 71
3 70
8 96
2 52
1 93
9 64
1 74
then in C1 copy this formula
=IF(AND(A1>=2,B1>=80),2,IF(AND(A1>=2,B1<80),1,IF(AND(A1<2,B1>=80),1,IF(AND(A1<2,B1>=80),0,""))))
copy C1 down
if you are interested only in color run this macro
keep the sheet as active sheet and run the macro
Sub test()
Dim r As Range, c As Range
Set r = Range(Range("A1"), Range("A1").End(xlDown))
For Each c In r
If c >= 2 And c.Offset(0, 1) >= 80 Then c.Offset(0, 2).Interior.ColorIndex = 4
If c >= 2 And c.Offset(0, 1) < 80 Then c.Offset(0, 2).Interior.ColorIndex = 6
If c < 2 And c.Offset(0, 1) Then c.Offset(0, 2).Interior.ColorIndex = 6
If c < 2 And c.Offset(0, 1) < 50 Then c.Offset(0, 2).Interior.ColorIndex = 3
Next c
End Sub