Looking for Sum formula based on a condition

sandhya16

New Member
Joined
Jun 8, 2015
Messages
34
i have a column containing 1 to 36 representing months(A2:A37) and i have one more cell(M1) in which i am calculating the month by taking difference between two dates.

So i want a formula that match M1 with A2:A37 value and based on match i want to add the column values(B2:B37) corresponding to match.

for eg. -if M1= 5 ,i want to get the sum from B7:B37 and so on depending on M1 value. if the value of M1 =0 then i want to sum from B2:B47.

Please help.
 
Last edited:

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Actually i am looking for formula to add from the starting ..sorry for the confusion

if M1=8 then add from B2 to B29 and if M1=0 add from B2 to B37..how to do that?
 
Upvote 0

Forum statistics

Threads
1,215,327
Messages
6,124,290
Members
449,149
Latest member
mwdbActuary

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