+ Reply to Thread
Results 1 to 7 of 7

Formula for a range between two variables in one cell

  1. #1
    Registered User
    Join Date
    07-12-2017
    Location
    Malaysia
    MS-Off Ver
    15.13.3
    Posts
    3

    Question Formula for a range between two variables in one cell

    I am making a packing list for my company and we want to number the cartons on the excel sheet. We number the cartons as a range e.g 001 - 005 which means the product is packed in 5 cartons, numbers 1 to 5. The next product has 2 cartons so the range would be 006 - 007. I want a method that allows my staff to input the quantity of cartons for each product and excel automates the numbering. The staff would write "2" in the cells E$10-E16 (or another hidden column, that's fine) and excel would input 001 - 002. In the next product column, they'd write "5" and excel would input 003 - 007.

    The second part of my question is: we also write the CBM (cubic meter) of the carton on the sheet, I'd like the staff to input a value in H2 and that value be multiplied by the "CTN number" in the same row E2 and the result to be input in the same CBM cell the staff wrote in (cell H2). How would I go about doing this? I prefer to use as few columns as possible and as few hidden columns as possible in order to avoid confusion as we're printing on A4, but I would like to hear all ideas you guys have :D

    Thank you in advance for the help
    Attached Files Attached Files
    Last edited by WadeMK; 07-12-2017 at 01:53 PM. Reason: Fixed a typo with 006-007

  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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,140

    Re: Formula for a range between two variables in one cell

    Welcome to the forum!

    Regarding the first query: you can't have data entry in hidden columns without the staff unhiding them first. Is this really what you mean? By the way, 2 cartons would be 006-007.
    Last edited by AliGW; 07-12-2017 at 03:22 AM.
    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
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,393

    Re: Formula for a range between two variables in one cell

    Put the staff-entered nuumber of cartons in a column off to the left (I used column A), and leave it out of the print area. I then used

    =TEXT(SUM($A$1:A1)+1,"000")&" - "&TEXT(SUM($A$2:A2),"000")

    to generate your result AFTER I killed your merged cell. Don't use them. they are the spawn of Satan and mess everything up.
    Attached Files Attached Files
    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

  4. #4
    Registered User
    Join Date
    07-12-2017
    Location
    Malaysia
    MS-Off Ver
    15.13.3
    Posts
    3

    Re: Formula for a range between two variables in one cell

    Quote Originally Posted by AliGW View Post
    Welcome to the forum!

    Regarding the first query: you can't have data entry in hidden columns without the staff unhiding them first. Is this really what you mean? By the way, 2 cartons would be 006-007.
    Ya the staff would unhide the columns, enter the data and then hide the columns again before printing and/or sending to the customer. Thanks for noticing the typo!

  5. #5
    Registered User
    Join Date
    07-12-2017
    Location
    Malaysia
    MS-Off Ver
    15.13.3
    Posts
    3

    Re: Formula for a range between two variables in one cell

    Quote Originally Posted by Glenn Kennedy View Post
    Put the staff-entered nuumber of cartons in a column off to the left (I used column A), and leave it out of the print area. I then used

    =TEXT(SUM($A$1:A1)+1,"000")&" - "&TEXT(SUM($A$2:A2),"000")

    to generate your result AFTER I killed your merged cell. Don't use them. they are the spawn of Satan and mess everything up.
    This is fantastic. Thank you so much! Sometimes we put different products in the same cartons. Example: 3 pcs of Product A and 2 psc of Product B are in Carton 1. Then 5 pcs of product A in Carton 2. The only way to show that is to either merge cells or repeat the carton numbers of Product A on Product B. I've been trying to use merged cells with your method and I think it would still work, spawn of Satan seems helpful sometimes

    Any idea for a solution about my second question? is there a way for the staff the type the CBM value of one carton in H2 (I2 in your document) and the value gets multiplied by A2 and the result is input into H2. I understand this might be unconventional but I'd rather use two columns for the job rather than three because I'm worried my staff will forget to hide a column before sending out the packing list. Many thanks again!

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

    Re: Formula for a range between two variables in one cell

    Good luck - but the Spawn of Satan will get you in the end. You have been warned.

    Anyhow...

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

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

    Re: Formula for a range between two variables in one cell

    Just noticed your supplementary Q. I'll try to remember to look at it in the UK morning. I'm signing out now... the sea bass is frying nicely.

+ 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. How do I assign the value of each cell from a range of cells to different variables?
    By JohnMichael in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-09-2017, 09:15 PM
  2. [SOLVED] Using range and cell variables in the series function
    By rachmanchester in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-29-2014, 05:57 PM
  3. [SOLVED] Countif formula for multplei variables in the same range of cells
    By rowena229 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-04-2014, 01:48 PM
  4. [SOLVED] Concatenate Variables to Represent a Cell Range - Possible?
    By MelissaGregory in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-11-2014, 11:12 AM
  5. Replies: 5
    Last Post: 02-26-2009, 11:03 AM
  6. Replies: 4
    Last Post: 07-31-2008, 09:04 PM
  7. specifying variables in a formula range
    By sv_hcl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-10-2005, 08:45 PM

Tags for this Thread

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