+ Reply to Thread
Results 1 to 6 of 6

Add 1 to a number from the worksheet before it

  1. #1
    Forum Contributor
    Join Date
    08-22-2005
    MS-Off Ver
    Office 365
    Posts
    342

    Add 1 to a number from the worksheet before it

    Hello Excel Guru's

    I have 3 Tabs (will be more – once I get some help with a workable formula) - Feb, Mar and April

    On the Feb tab you will see 5 columns with number shift rotations

    On the Mar tab I want to refer to the Feb Tab same column and add 1 to the rotation number.

    I can do this by simplifying pointing back to the Feb sheet and then do a + 1.
    But the problem is when I get to 30 and it adds 1 it goes to 31 which is not a shift rotation.

    I have highlighted on the Feb tab see test workbook what is happening when I use the simple + 1
    How can I get the same result every time I refer back to the previous sheet but having the 31 be 6

    The Apr tab refers back to the Mar tab.
    The Mar tab shows the desired output I am looking for

    Long Story short .. each tab will refer the previous and Add 1 to the number except for if the cell is referring to 30 I need it to go back to 6.

    Let me know if you have any questions and Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: Add 1 to a number from the worksheet before it

    Try this instead:

    =IF(Feb!A2=30,6,Feb!A2+1)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Add 1 to a number from the worksheet before it

    Try this in A2, copied down and across...
    =IF(Feb!A2+1>30,6,Feb!A2+1)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Contributor
    Join Date
    08-22-2005
    MS-Off Ver
    Office 365
    Posts
    342

    Re: Add 1 to a number from the worksheet before it

    Thank You. Suspected an IF statement was going to be needed just could not figure it out myself. Now that I see it I understand it.

    Thanks for the quick reply's you guys never fail to amaze me.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Add 1 to a number from the worksheet before it

    Happy to help
    (I prefer Ali's, it's simpler)

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: Add 1 to a number from the worksheet before it

    You're welcome!

    I think they are both as simple as each other!

+ 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. [SOLVED] Macro to sum values from one Worksheet to another worksheet basd on part number
    By sunburst in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-16-2014, 11:27 AM
  2. [SOLVED] If serial number from one worksheet matches on other worksheet, copy the contents
    By stangz71 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 03-24-2014, 10:21 PM
  3. Search worksheet for certain text + number combo and then increment the number
    By hal9000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2013, 06:09 PM
  4. [SOLVED] Copy set number of cells a set number of times within same worksheet
    By hal9000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2013, 11:51 AM
  5. [SOLVED] Replacing a referenced worksheet name with a variable worksheet index number.
    By sdavison in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-01-2013, 09:49 AM
  6. Basic Question - How do I return the worksheet number of the active worksheet?
    By Regnab in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2006, 10:10 PM
  7. add 'x' number of worksheets based on a number in a worksheet.
    By mmamin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-12-2005, 07:11 AM

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