+ Reply to Thread
Results 1 to 3 of 3

If statement

Hybrid View

  1. #1
    Registered User
    Join Date
    03-07-2004
    Location
    Pakistan
    MS-Off Ver
    MS Office Pro Plus 2016
    Posts
    41

    If statement

    Hi
    Please help me to create formula for this situation
    there is data in A1 to A30
    there is Date in B1 to B30
    Now I want to get In C1 to C30

    A1 - B1 = C1 ,
    and IF
    date received in C1 is larger than 20 , it should display 0, other wise display ther result that is equal to A1 - B1 = C1

    Best Ragards
    I love to learn

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Are you trying to say there are dates in column A, dates in column B, and you want to find the difference between A and B? And if that difference is greater than 20, show a 0 in column C, otherwise show the difference?

    If so, in C1 put the formula:

    =IF(A1-B1>20,0,A1-B1)

    and then fill that down as many rows as you need.

    If you want to get fancy, try:

    =IF(DATEDIF(B1,A1,"D")>20,0,DATEDIF(B1,A1,"D"))

    It does the same thing, just a different way.

  3. #3
    Registered User
    Join Date
    03-07-2004
    Location
    Pakistan
    MS-Off Ver
    MS Office Pro Plus 2016
    Posts
    41
    Thanks
    these are not dates, just simple figures,
    anyway it solve my problem
    best regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1