Excel SUMIFS Formula to Sum Vendor Spending by Month
Question details
Use one formula to retrieve total spending for a specified vendor and month from a table with vendors in rows and months in columns.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Vendor names are listed in column A, month headers are in row 1, and spending amounts are arranged under each month.
- Observed behavior
- The desired result is the sum of amounts for the selected vendor in the selected month column.
Check that vendor names are in A2:A100, month headers are in B1:M1, and amounts are in B2:M100. Ensure the selected month matches its header value, including the underlying date if the headers are dates.
Use SUMIFS with INDEX and MATCH to select the month column
Use this formula when months are separate columns and a vendor may appear in more than one row.
Enter the vendor name in O2 and the month to look up in O3. The month value must match a header in B1:M1.
Select an empty result cell and enter =SUMIFS(INDEX($B$2:$M$100,0,MATCH(O3,$B$1:$M$1,0)),$A$2:$A$100,O2).
Press Enter. MATCH finds the month column, INDEX supplies that column to SUMIFS, and SUMIFS adds the amounts for matching vendor rows.
Edit the ranges in the formula to fit your table. Keep the vendor range and amount range aligned on the same rows.

Calculate Vendor Spending by Month in WPS Spreadsheets
Open your workbook in WPS Spreadsheets and use SUMIFS with INDEX and MATCH to total a vendor's spending in the selected month column.
- 1. Open the workbook: In WPS Spreadsheets, choose Open and select your Excel workbook.
- 2. Enter the criteria: Enter the vendor name in O2 and the matching month header value in O3.
- 3. Add the formula: Select an empty cell and enter =SUMIFS(INDEX($B$2:$M$100,0,MATCH(O3,$B$1:$M$1,0)),$A$2:$A$100,O2).
- 4. Review and save: Press Enter to display the total, then choose Save or Save As to save the workbook.

Frequently Asked Questions
Why does the formula return #N/A?
MATCH cannot find the value in O3 in B1:M1. Check for differences in spelling, spaces, or underlying date values, even if the displayed month looks the same.
What happens if a vendor appears in multiple rows?
SUMIFS adds all amounts in the selected month column for rows whose vendor name matches O2.
Can I use SUMIFS if my data has separate Vendor, Month, and Amount columns?
Yes. For example, if those columns are A, B, and C, use =SUMIFS(C2:C100,A2:A100,O2,B2:B100,O3).
What if the same month header appears more than once?
MATCH(O3,$B$1:$M$1,0) selects the first exact match. Make the headers unique or adjust the formula to target the intended column.




