Which formula to use

santnok

Board Regular
Joined
Jan 10, 2014
Messages
97
Hi
Hope somone can help me out with a formula here.
I have have a start date and a end date column for each project.
As you see, in the column for the month Jan, Feb and so on I have manually filled out how many days from the start date to the end date.
So for project 1 I have to fill out 16 days for Jan and 28 days for feb and 31 days for Mar and 18 days for Apr.
And for the Project 2 I must do the same thing.

Is there a way to use a formula that can fill out the numbers automaticlly when and give a start and end date?

Bok1.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACAD
1
2Start date01.01.2021
3End date31.12.2022
4
5
6
720212022
8ProjectnameProject numberStart dateEnd dateProject daysJanFebMarAprMaiJunJulAugSepOktNovDesJanFebMarAprMaiJunJulAugSepOktNovDes
9Projekt 1D387815.01.202118.04.20219316283118
10Projekt 2D387913.05.202118.03.2022309182831303130313130313031312818
Ark1
Cell Formulas
RangeFormula
E9:E10E9=SUM(D9-C9)


Thanks for all answers :)
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Try:

Book2
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACAD
1
2Start date1/1/2021
3End date12/31/2022
4
5
6
720212022
8ProjectnameProject numberStart dateEnd dateProject daysJanFebMarAprMayJunJulAugSepOctNovDecJanFebMarAprMayJunJulAugSepOctNovDec
9Projekt 1D38781/15/20214/18/2021931728311800000000000000000000
10Projekt 2D38795/13/20213/18/202230900001930313130313031312818000000000
Sheet4
Cell Formulas
RangeFormula
G9:AD10G9=MAX(0,MIN(EOMONTH(G$8,0),$D9)-MAX(G$8,$C9)+1)
E9:E10E9=D9-C9


Note that the G8:AD8 cells have an actual date in them, the 1st of the month for that month and year, and they're just formatted to show the month.
 
Upvote 0
Try the follwing

T202110b.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACAD
1
2Start date1-Jan-21
3End date31-Dec-22
4
5
6
720212022
8ProjectnameProject numberStart dateEnd dateProject daysJan-21Feb-21Mar-21Apr-21May-21Jun-21Jul-21Aug-21Sep-21Oct-21Nov-21Dec-21Jan-22Feb-22Mar-22Apr-22May-22Jun-22Jul-22Aug-22Sep-22Oct-22Nov-22Dec-22
9Projekt 1D387815-Jan-2118-Apr-21931628311800000000000000000000
10Projekt 2D387913-May-2118-Mar-2230900001830313130313031312818000000000
2a
Cell Formulas
RangeFormula
G9:AD10G9=MAX(0,MIN(EOMONTH(G$8,0),$D9)-MAX(G$8-1,$C9))
E9:E10E9=D9-C9
 
Upvote 0
Thank you verry much for all answers worked perfect :)
Can I ask also if its posible to automaticly set the row for Jan, Feb, Mar to be filled out for the range start and end date for each year?
I thinking then about the start and end date that are in the top og the sheet

Thanks again for help :)
 
Upvote 0
If you have Excel 365, clear out G8:AD8 and put this in G8:

Excel Formula:
=EDATE(J2,SEQUENCE(,24,0))

where 24 is the number of months you want.


If you don't have Excel 365, clear out G8:AD8 and put this in G8:

Excel Formula:
=EDATE($J$2,COLUMNS($G6:G6)-1)

and drag to the right as far as needed.


Also, we can adapt our formulas to show the number of work days if you like, instead of calendar days.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

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