+ Reply to Thread
Results 1 to 10 of 10

manipulating values from IF statement

  1. #1
    Registered User
    Join Date
    11-26-2012
    Location
    worcester
    MS-Off Ver
    Excel 2010
    Posts
    17

    Question manipulating values from IF statement

    Hi,

    I want to pull values from a nested IF statement.

    The sheet work like this:

    I select a value in cell A2 which displays the associated cost in cell B2, I then want to total the cells in B2 using a simple SUM but am unable to do this, (the value remains at zero).

    I am assuming this is because the values are being pulled from the nested IF statement in cell B2.

    Is there a way of doing getting the total?

    Hope this makes sense?

    Thanks

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: manipulating values from IF statement

    I'm confused as to what you really want. You said you want to total the cells in B2... but B2 IS only one cell. If you could upload a sample spreadsheet with your requirements and expected output/solution, it would be a lot easier to help.

    - Moo

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: manipulating values from IF statement

    It might make more sense if you posted a sample workbook which shows what data and formulae you have and what you are trying to achieve. The FAQ describes how you can attach a file to a post - basically, click on Go Advanced, then either use the paperclip icon or scroll down and click Manage Attachments, and then follow the steps.

    Hope this helps.

    Pete

  4. #4
    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
    53,047

    Re: manipulating values from IF statement

    I agree with the above 2 suggestions. however, have you tried to play around with either sumif() or sumifS(), rather than use nested IF() statements?
    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

  5. #5
    Registered User
    Join Date
    11-26-2012
    Location
    worcester
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: manipulating values from IF statement

    Quote Originally Posted by Moo the Dog View Post
    I'm confused as to what you really want. You said you want to total the cells in B2... but B2 IS only one cell. If you could upload a sample spreadsheet with your requirements and expected output/solution, it would be a lot easier to help.

    - Moo
    Thanks for the prompt replies

    I have now attached a cut down version of the worksheet so hopefully you will see what I am asking.
    Attached Files Attached Files

  6. #6
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: manipulating values from IF statement

    You probably should do away with the nested IF formula and go with this: (Put in B2 and fill down)

    =IFERROR(VLOOKUP(A2,data!$A$3:$B$21,2,0),"")

    - Moo

  7. #7
    Registered User
    Join Date
    11-26-2012
    Location
    worcester
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: manipulating values from IF statement

    That is great, could you explain what is happening in that formula?

  8. #8
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: manipulating values from IF statement

    The IFERROR part checks to see if the result of the formula is an error, and if so, results in a blank cell.

    The VLOOKUP tells Excel to look for the value that is in cell A2, and find it on the 'data' sheet (data!$A$3:$B$21) in column A, and return the corresponding value from column B (,2) and only if it is an exact match (,0).

    Excel's built-in help system can help you out, too. Also, you can type =VLOOKUP into a cell then hit the Fx button just left of the formula bar, and a Formula Helper will pop up to guide you along the way.

    Hope that helps!

    - Moo

  9. #9
    Registered User
    Join Date
    11-26-2012
    Location
    worcester
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: manipulating values from IF statement

    Thanks for your help, I' sure i will be back!

  10. #10
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: manipulating values from IF statement

    You're welcome rchapman. Glad I could help!

    - Moo

    - - - - - - - - - -
    If you are satisfied with the solution(s) provided, please mark the thread as [SOLVED] by clicking on the words 'Thread Tools' above your 1st post in this thread. Then select 'Mark Thread as Solved'.

    Also, a good way to 'Say thanks' to those who have helped is to click on the star below their name in one of their posts. It's always appreciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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