+ Reply to Thread
Results 1 to 13 of 13

Formula that adds two separate cells if a third cell has a certain value into another cell

  1. #1
    Registered User
    Join Date
    08-05-2014
    Location
    FL
    MS-Off Ver
    Latest
    Posts
    6

    Formula that adds two separate cells if a third cell has a certain value into another cell

    I'm working on a spreadsheet that includes items I sell as well as the packaging it goes in.

    The formula I'm looking for basically will tell a cell that if one cell (# of box) is equal a certain # it will add two separate cells by the weight of the box.

    I have cells for each of the following: Weight in lb and weight in oz of the item (no box), a cell which holds the number of the box (ranging from 1-15) and two cells with weight in lb and weight in oz which would be the total weight of the item + box.

    So, for example, if weight of item equals 1 and box cell equals 2 then it will put the weight of item + weight of box into a third cell.

    Here's a picture of my current spreadsheet, still being worked on if it helps.

    http://i.imgur.com/qGnldj8.png

    Basically, I would like to do something such as if P3 = 5, then Q3 will equal N3 + U6 and R3 will equal O3 + V6.
    Attached Images Attached Images
    Last edited by Zyner; 08-05-2014 at 03:15 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: Formula that adds two separate cells if a third cell has a certain value into another

    hi Zyner,

    it would be much easier to help you if you uploaded your workbook. also, if you could include a sample worksheet demonstrating what your desired outcome would be.

    the formula should be something along the lines of:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    (untested...)

    but it's really hard to be sure based on the images you attached.

  3. #3
    Registered User
    Join Date
    08-05-2014
    Location
    FL
    MS-Off Ver
    Latest
    Posts
    6

    Re: Formula that adds two separate cells if a third cell has a certain value into another

    Here's a quick mock-up of my worksheet with what I assume is all the data needed.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Formula that adds two separate cells if a third cell has a certain value into another

    Had to rearrange the package info into one consecutive table.
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: Formula that adds two separate cells if a third cell has a certain value into another

    Thanks Zyner,

    I'm still not sure what we're trying to accomplish. Which cells have the desired output and what should the desired output look like? It looks like you have 11 packages each with their own "package number", but only 8 boxes. How do I know which box is used for which package?

    also, am I correct in assuming you want to see the lbs in column D and the ounces in column E? or do you want those two numbers together in the same cell?

  6. #6
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: Formula that adds two separate cells if a third cell has a certain value into another

    ah, thanks hoyasaxa, I didn't catch that package # might tie to either box or envelopes.

    here's one way to do it without merging the datasets...

    does it bother you that the oz column can return a number higher than 16?
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-05-2014
    Location
    FL
    MS-Off Ver
    Latest
    Posts
    6

    Re: Formula that adds two separate cells if a third cell has a certain value into another

    Quote Originally Posted by simarui View Post
    ah, thanks hoyasaxa, I didn't catch that package # might tie to either box or envelopes.

    here's one way to do it without merging the datasets...

    does it bother you that the oz column can return a number higher than 16?
    I kept them separated because one column is for boxes while the other is for envelopes. Technically, it does bother that they can equal mover 16 in the oz column because anything over becomes a pound, but I'm sure I could just do the math by hand for those occurrences unless there's a way to make the formula also have oz to lb conversion but that would include adding that value to the other cell.

    I'm looking at the formula you made but it doesn't seem to do the math right.
    For example, B12 is 1.50 with Packabe #11 / C12. So E12 should equal 1.50 + 1.20 (M5, Package #11) = 2.7 but comes out as 2.19.

    I've also made a quick edit to the table, moved an envelope row that was under the box column to the side.

    On the weight columns for Boxes the left one is pounds while the right one is ounces, that is why I have two columns under weights for everything (if that info helps), while envelopes only weight in ounces.

    Thanks Zyner,

    I'm still not sure what we're trying to accomplish. Which cells have the desired output and what should the desired output look like? It looks like you have 11 packages each with their own "package number", but only 8 boxes. How do I know which box is used for which package?

    also, am I correct in assuming you want to see the lbs in column D and the ounces in column E? or do you want those two numbers together in the same cell?
    I have 7 different box types and 8 different envelope types, each with their own corresponding number.
    My desired output is for the left column (pounds/lb) to equal the weight in pounds of the item + the weight in pounds of the box while the right column has the weight of the item in ounces + the weight of the box/envelope in ounces. This two columns are under Weight w/ box (lb & oz), where as the previous weight columns are of the item alone.
    I will be inputting which box/envelope number goes into column C/Package #, what I would like is if there could be a formula that will change its calculations based on what number is on that column.

    So I suppose what I'm trying to say is based on whatever number is on column C it will give a calculation that's appropriate to that number into columns D & E. The numbers that are currently on that I'm sharing with you are just to test with and will be changed (the numbers on column C).

    I have pounds and ounces separated due to some ounces coming with numbers after their decimal point. If you can find a way to automatically calculate into one cell for pounds & ounces to be combined as well as conversion from ounces to pounds if required that would help out a lot; I kept them separated because I wouldn't make a formula that would add them because it would input 1.0 lb + 2.5 oz and equal 3.5 lb.

    It does at least seem a step in the right direction so I thank you for the effort in helping me thus far.
    Attached Files Attached Files
    Last edited by Zyner; 08-05-2014 at 03:05 PM.

  8. #8
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Formula that adds two separate cells if a third cell has a certain value into another

    Replace the equation in E2 with the one below and copy down. Inadvertently looked up wrong column of data.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    08-05-2014
    Location
    FL
    MS-Off Ver
    Latest
    Posts
    6

    Re: Formula that adds two separate cells if a third cell has a certain value into another

    Quote Originally Posted by hoyasaxa215 View Post
    Replace the equation in E2 with the one below and copy down. Inadvertently looked up wrong column of data.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This seems to be working perfectly. I assume that the formula for A2 remains correct?

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  10. #10
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Formula that adds two separate cells if a third cell has a certain value into another

    That is correct.

  11. #11
    Registered User
    Join Date
    08-05-2014
    Location
    FL
    MS-Off Ver
    Latest
    Posts
    6

    Re: Formula that adds two separate cells if a third cell has a certain value into another

    Quote Originally Posted by hoyasaxa215 View Post
    That is correct.
    Thank you, as well as simarui, very much for your help and I appreciate it greatly.

  12. #12
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: Formula that adds two separate cells if a third cell has a certain value into another

    thanks again hoyasaxa,

    Zyner,

    the attached incorporates hoyasaxa's fix above and uses some additional criteria to force oz over 16 into the lbs column.

    I'm sure I can put it all in one column if you want it, but this is already done if it's all the same to you.
    Attached Files Attached Files
    Last edited by simarui; 08-05-2014 at 03:38 PM. Reason: boxweights.xlsx didn't save my changes... boxweights v2 has the changes mentioned in the post.

  13. #13
    Registered User
    Join Date
    08-05-2014
    Location
    FL
    MS-Off Ver
    Latest
    Posts
    6

    Re: Formula that adds two separate cells if a third cell has a certain value into another

    Quote Originally Posted by simarui View Post
    thanks again hoyasaxa,

    Zyner,

    the attached incorporates hoyasaxa's fix above and uses some additional criteria to force oz over 16 into the lbs column.

    I'm sure I can put it all in one column if you want it, but this is already done if it's all the same to you.
    Thank you very much, this is perfect.

+ 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] Splitting formula Values from one cell into separate cells
    By thegrandmaster in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-05-2013, 02:17 AM
  2. Replies: 5
    Last Post: 11-21-2013, 06:00 PM
  3. Replies: 8
    Last Post: 03-14-2013, 04:40 PM
  4. [SOLVED] Formula looking at two separate cells resulting in one cell
    By jkr4250 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-11-2013, 11:05 AM
  5. Adds text in one cell based on two other cells
    By tex3285 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-12-2011, 05:32 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