Forum Discussion

RobertoKartoredjo's avatar
RobertoKartoredjo
Copper Contributor
Aug 06, 2022
Solved

Return latest date for billing

I need a formula to help me with the billing process. I want it to help with if billing is YES of NO.
Please see below excel example.

Billing is YES if any equipment went to for inspection or went for inspection after 5 workdays. Billing is NO if any equipment went for inspection within 5 workdays. (not counting Saturdays and Sundays) 
But if the equipment went for inspection on a Saturday the formula will need to count the Saturdays also. 

 

Someone already helped me with the following formulas:

- IF(NETWORKDAYS(MAXIFS(A$1:A1,G$1:G1,G2),A2)>5,"YES","NO"). Here it only counts the workdays.

- IF(NETWORKDAYS.INTL(MAXIFS(A$1:A1,G$1:G1,G2),A2,11)>5,"YES","NO"). Here it doesn't count the Sundays only.

 

But somehow i need to put these 2 together. Cause if the equipment went for inspection on a Saturday it does need to count the Saturday + the normal workdays. And if an equipment went on a normal workday (Mon-Fri)  it doesn't count the Saturday and Sunday. 

 

 

CLIENTINSPECTION DATEINSPECTION VALID TILLINSPECTION LOCATIONBUSINESS PARTNER NAMEEQUIPMENT MODELEQUIPMENT NUMBERLICENSE NUMBERSTATUSSTICKER NUMBERBILLABLE
Mike23-Jun-2120-Jul-21ParboFORDBUSPOO17485A6dBPASSED  YES
Brock16-Jul-22 ParboHCABUSPOO17485A6dBFAILED YES
Mike22-Jul-2215-Aug-21WanicaHCABUSPOO17485A6dBPASSED  NO
Mike14-Aug-2111-Sep-21WanicaBLUEBUSPOO17485A6dBPASSED  YES
Brock18-Nov-2110-Feb-22ParboBAYD-MAXPOO123301w9hpPASSED  YES
Brock18-Nov-2110-Feb-22WanicaHCAAMAROKPOO12343e71gzPASSED  YES
  • HansVogelaar's avatar
    HansVogelaar
    Aug 06, 2022

    RobertoKartoredjo 

    Perhaps

     

    =IF(NETWORKDAYS.INTL(MAXIFS(A$1:A1,G$1:G1,G2),A2,IF(OR(WEEKDAY(A2)=7,WEEKDAY(MAXIFS(A$1:A1,G$1:G1,G2))=7),11,1))>5,"YES","NO")

8 Replies

    • RobertoKartoredjo's avatar
      RobertoKartoredjo
      Copper Contributor

      SergeiBaklan 

       

      Thank you. But i do get the following below. On the 20 Aug the billing is supposed to be YES. 

      INSPECTION DATEINSPECTION VALID TILLINSPECTION LOCATIONBUSINESS PARTNER NAMEEQUIPMENT MODELEQUIPMENT NUMBERLICENSE NUMBERSTATUSSTICKER NUMBERBILLABLE
      5-Aug-22 CALYPSONAARTKO NVBUS - CAT 3 3498BBFAILED YES
      12-Aug-22 CALYPSONAARTKO NVBUS - CAT 3 3498BBPASSED YES
      15-Aug-22 CALYPSONAARTKO NVBUS - CAT 3 2222CDFAILED YES
      20-Aug-22 CALYPSONAARTKO NVBUS - CAT 3 2222CDPASSED NO