Hello My Dear,I Want Your Help to Adjust this equation for dividing the number of nights for each employee name based on the beginning of the date
for example : if Ahmed Khalifa in sheet1 start his Stay from 08/05/2022 till 13/05/2022 ,, it mean he will stay 5 Night ..i Want to Divid this Number Of Nights From 08/05/2022 in Summary Sheet ..To be in each cell number 1 until the end of the period, which will be on 12/05/2022
	
	
	
		
If Possible  Function Shorter Than This One
thanks with my Best Regards
				
			for example : if Ahmed Khalifa in sheet1 start his Stay from 08/05/2022 till 13/05/2022 ,, it mean he will stay 5 Night ..i Want to Divid this Number Of Nights From 08/05/2022 in Summary Sheet ..To be in each cell number 1 until the end of the period, which will be on 12/05/2022
		Code:
	
	=IF(AND(B2<>"",SUM($B2:B$3)<=VLOOKUP($A2,Sheet1!$D$2:$G$170,4,0)),MROUND(VLOOKUP($A2,Sheet1!$D$2:$G$170,4,0)/VLOOKUP($A2,Sheet1!$D$2:$G$170,4,0),0),IF(VLOOKUP($A2,Sheet1!$D$2:$G$170,2,0)=C$1,MROUND(VLOOKUP($A2,Sheet1!$D$2:$G$170,4,0)/VLOOKUP($A2,Sheet1!$D$2:$G$170,4,0),0),""))thanks with my Best Regards
Attachments
			
				Last edited: 
			
		
	
								
								
									
	
								
							
							 
	 
			 
			 
			


 
			