how to calculate YTD with 2 criterias

mart_mrexcel

Active Member
Joined
Aug 23, 2008
Messages
296
Office Version
  1. 365
Platform
  1. Windows
how to calculate YTD with 2 criterias (i.e. heading is the month from B1 to M1 and Specific Code in the column A2 TO A10)

Example
A2 – A10 has name of the fruits
B1 to M1 has Jan to Dec
Each fruit has a value from Jan – Dec entered in B2 – M10

I want to get the YTD total of fruit if I type in the name of the fruit and select the month in the dropdown list
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
how to calculate YTD with 2 criterias (i.e. heading is the month from B1 to M1 and Specific Code in the column A2 TO A10)

Example
A2 – A10 has name of the fruits
B1 to M1 has Jan to Dec
Each fruit has a value from Jan – Dec entered in B2 – M10

I want to get the YTD total of fruit if I type in the name of the fruit and select the month in the dropdown list


=SUM(OFFSET($A$1,MATCH($P$2,$A$2:$A$5,0),1,1,MATCH($P$3,$B$1:$M$1,0)))

assuming P2 is the fruit and P3 is the month
 
Upvote 0

Forum statistics

Threads
1,215,371
Messages
6,124,529
Members
449,169
Latest member
mm424

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top