Using if and then to add values to a cell
Try using the SUMIF function for one condition or multiple conditions. Use the SUMIF worksheet function to create a total value for one range based on a value in another range. For example, for every cell in the rage B5:B25 that contains the value "Northwind", the following formula calculates the total for the corresponding cells in the range F5:F25. Formula:
=sumif(B5:B25,"Northwind",F5:F25)
Here are SUMIF functions for multiple conditions.
=sum(if((B5:B25="Northwind")*(C5:C25="Western"),F5:F25))
=sum(if((B5:B25="Northwind")+(C5:C25="Western"),F5:F25))
=sum(if(B5:B25="Northwind",IF(C5:C25="Western"),1,0)))
Also check your help for SUMIF functions.
If this helps you, Please rate me. Thanks, Patty
×