A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Dear @Lindsay MacLeod,
Thank you for reaching out to Microsoft Q&A forum.
I understand that you're looking for a conditional calculation that dynamically maps a financial value to a specific timeframe based on both a category (cell H3) and a date (cell F3). This means you need a formula that performs an IF check followed by date-matching logic.
Assuming your column headers (O2 through Z2) contain valid Excel date values (e.g., Jan-2026, Feb-2026), you can use the following formula in cell O3 and copy it across:
=IF($H3="X",IF(AND(MONTH($F3)=MONTH(O$2), YEAR($F3)=YEAR(O$2)), $D3, 0),0)
How this logic works
- $H3="X": This acts as your primary gatekeeper; if the cell does not contain "X", the formula returns 0.
- MONTH($F3)=MONTH(O$2) and YEAR($F3)=YEAR(O$2): Ensures the transaction date matches the month and year in the column header.
- $D3: If both conditions are met (H3 is "X" AND the dates match), Excel will populate the dollar amount.
I hope this helps. If it doesn't behave as expected, feel free to share a sample structure and I’ll gladly refine the solution further. I'm looking forward to your reply.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.