excel formula if column A equals ABC, sum column b
- User
excel formula if column A equals ABC, sum column b
- Assistant
You can achieve this using Excel's
SUMIFfunction. TheSUMIFfunction allows you to sum the values in a range that meet specified criteria.Here’s how you can write the formula:
=SUMIF(A:A, "ABC", B:B)This formula will:
- Look through all of Column A.
- Identify the cells that contain the text "ABC".
- Sum the corresponding values in Column B where the condition is met.
If you need a case-insensitive match (e.g., it should sum values for "abc", "ABC", "Abc", etc.), Excel will handle this naturally as text matching in
SUMIFis case-insensitive.If you have different criteria or additional conditions, you may need the
SUMIFSfunction (which allows for multiple criteria). - User
excel formula if column A drop box choose "ABC", sum column b
- Assistant
If you have a drop-down list (created via Data Validation) in a specific cell, say cell
C1, and you want to sum the values in Column B where the entries in Column A match the selection from the drop-down list, you can use theSUMIFfunction.Assuming your drop-down list is in cell
C1, here's the formula you would use:=SUMIF(A:A, C1, B:B)This formula will:
- Look through all of Column A.
- Match the entries in Column A with the selection in cell
C1. - Sum the corresponding values in Column B where the condition is met.
This way, whenever you change the selection in the drop-down list in cell
C1, the sum will automatically update based on the new selection.