• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need help in the formula

cyliyu

Member
Need help to get the formula corrected.
Just discovered there was an error in the formula in the spreadsheet.

The formula was used to calculate the days the s/no AND d/c last happen compare with 1st time happen.
e.g.
in row 24 in the spreadsheet, the no of days was 362.
In row 25 when the same s/no keyed in but different d/c, the days in row 24 changed to R instead of 362.
The result should be row 25 = ∞ since first time happen and
row 24 should remain as 362 (31 Aug 18 - 31 Aug 17)

Code:
=IF(E23="","",IF(B23="","Error",IF(E23=0,"",IF(E23=1,"∞",IF(COUNTIF(C23:C$30,C23)=1,LARGE(IF($C$6:$C$30=C23,$B$6:$B$30),1)-LARGE(IF($C$6:$C$30=C23,$B$6:$B$30),2),"R")))))
 

Attachments

  • Chandoo_Days_Check.xlsx
    22.4 KB · Views: 6
Yes, Tried, but not working. will try again. thanks.

Updates:- Think I got it works.

Code:
=IF(E23="","",IF(B23="","Error",IF(E23=0,"",IF(E23=1,"∞",IF(COUNTIFS(C23:C$30,C23,D23:D$30,D23)=1,LARGE(IF($C$6:$C$30=C23,IF($D$6:$D$30=D23,$B$6:$B$30)),1)-LARGE(IF($C$6:$C$30=C23,IF($D$6:$D$30=D23,$B$6:$B$30)),2),"R")))))
 
Last edited:
Back
Top