+ Reply to Thread
Results 1 to 4 of 4

Formula to minus 1 day based upon content of another cell

  1. #1
    Registered User
    Join Date
    08-13-2013
    Location
    Staffordshire
    MS-Off Ver
    Excel 2010
    Posts
    31

    Formula to minus 1 day based upon content of another cell

    Am sure it's fairly simple to do and I am fairly certain I have done this before I just cant find the SS I did it in!

    I would like a formula where dependent on the number in 1 cell, 1 day is minused from the date.

    I.e. if the contents of cell A1 is less than 7, then take 1 day from the date in cell B1, otherwise give me the date in cell B1

    I thought I had got it using an IF statement, but it is doing something weird and adding a year on.

    Thanks in advance

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Formula to minus 1 day based upon content of another cell

    Try this:

    =IF(A1<7,B1-1,B1)
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to minus 1 day based upon content of another cell

    One way...

    =B1-(A1<7)

    Format as Date
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    08-13-2013
    Location
    Staffordshire
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Formula to minus 1 day based upon content of another cell

    Thanks for the assitance!

    Have sorted it now, I had done it the way Glen suggested but for some reason it hadn't worked, retyped as per above and it now works!

    In my humble opinion, Excel is really weird somtimes

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 07-07-2014, 11:52 AM
  2. [SOLVED] Need to revise a formula based on content of a cell
    By mikerules in forum Excel General
    Replies: 17
    Last Post: 03-22-2014, 02:16 AM
  3. Automatically copy cells content based on the content of another cell.
    By chrisbarlow1984 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-01-2014, 11:13 AM
  4. Subtraction formula based on cell content
    By Meeciemae in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-16-2012, 03:10 PM
  5. copying cell content into a specific workbook based on the content in that cell
    By krishna reddy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-20-2012, 03:52 AM
  6. Formula, fill in descriptions based on cell content
    By sinnes in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-25-2010, 04:41 PM
  7. Replies: 2
    Last Post: 12-19-2006, 10:50 PM

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