Google-sheets – spreadsheet conditional: if in top x then

formulasgoogle sheets

spreadsheet data:

Total   Average Highest Top Sales   
$23,550.00  $7,850.00   $8,100.00   not 
$42,700.00  $14,233.33  $14,400.00  not 
$30,500.00  $10,166.67  $10,300.00  not 
$37,840.00  $12,613.33  $12,940.00  #ERROR! (H8=H19) OR (H8=h17)
$12,700.00  $4,233.33   $4,600.00   not 
$15,950.00  $5,316.67   $5,450.00   not 
$30,550.00  $10,183.33  $10,600.00  not 
                
                
                
                
                
top $14,233.33          
                
second  $12,613.33          
        

For the "top" and "second" these are calculated with:

=LARGE(UNIQUE(H1:H11),1) and =LARGE(UNIQUE(H1:H11),2) to get the largest and second largest values.

The logic I want to implement is if the average is equal to or greater than the first or second "top values" (at the bottom of the spreadsheet) then print true/false or yes/no in the J column.

Yes, you can also say: if the average for this row is greater than or equal to the second highest value then…but I prefer the first conditional.

How is this expressed with if/then in google spreadsheets? I have:

=if((H8=H19) OR (H8=h17), "top", "not")

but that's not evaluating, it just gives an error.

Best Answer

=if(OR(H8>=H19, H8 >=h17), "top", "not")

Syntax: OR(condition 1, Condition 2)