+ Reply to Thread
Results 1 to 24 of 24

Excel Formula to pull data from another sheet and place cell blank if value is 0

  1. #1
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    Exclamation Excel Formula to pull data from another sheet and place cell blank if value is 0

    Hi All,

    Need an excel formula for this requirement..

    I am pulling values from another sheet to current sheet..

    For Example:

    "Sheet1" is my current sheet and "Sheet2" is the sheet from which I need to pull the values.

    The values in sheet 2 will be in column A,C,E,G etc [alternate cells]. The Sum of these cells should be placed in Column A of "Sheet1"

    So the requirement is as below:

    1. I need to check if there any value exists in alternate cells of "Sheet2". If no value exists in any of alternate cells, then leave column A of Sheet1 blank.
    2. If alternate cells of Sheet2 has values, then take the sum of the values.
    a) If the Sum of the value is 0, then then leave column A of Sheet1 blank.
    b) If the Sum of the value is greater than 0, then place that value in Column A of Sheet1.

    Thank you.

  2. #2
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    Sample Attached...

    Sheet1 is the result what I want and Sheet2 contains the actual values.. I am taking the sum of alternative cells A,C,E,G
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor
    Join Date
    09-15-2011
    Location
    Chennai, India
    MS-Off Ver
    Excel 2010
    Posts
    436

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    Please try this file.
    Attached Files Attached Files
    Please click 'Add reputation', if my answer helped you.

  4. #4
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    Hi,

    I could see that, you had put formula in only cell A1 and A4.. but in my case I might/might not have values in other cells.. so based on that it should calculate..

    For example.. in my sample file attached.. in Sheet2. 2nd row has values 0.. so it should first get the sum of all these values then it should check if it is 0 or greater than 0.. if 0 dont put anything.. else put the sum of values.. this should be same for all cells... also if the cells in sheet2 are blank then it should not put anything in sheet1

  5. #5
    Valued Forum Contributor
    Join Date
    09-15-2011
    Location
    Chennai, India
    MS-Off Ver
    Excel 2010
    Posts
    436

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    You are right. Please drag down the formula from A1.
    Attached Files Attached Files
    Last edited by ramananhrm; 09-17-2013 at 01:08 AM.

  6. #6
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    Try this:

    =IFERROR(1/(1/SUMPRODUCT(--(MOD(COLUMN(Sheet2!A1:G1),2)),Sheet2!A1:G1)),"")

  7. #7
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    Hi,

    This updated file looks good but still in A2 and A3 i dont want to put anything because if the sum of values are zero then i should show a blank cell and also if there is nothing in sheet2 then also i should show blank cell..

    Here for A2, sum of values are zero.. so it should be blank
    for A3, nothing is there in Sheet2 to get the sum, so this should also be blank...

    In otherwords.. now your formula is placing zero in some cells.. so if it is zero then just show blank cell.. is it possible?

  8. #8
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    Quote Originally Posted by Teethless mama View Post
    Try this:

    =IFERROR(1/(1/SUMPRODUCT(--(MOD(COLUMN(Sheet2!A1:G1),2)),Sheet2!A1:G1)),"")
    Hi,

    I am getting an error if I paster this formula in the cell and click on enter!!

  9. #9
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    See post #6

  10. #10
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    Quote Originally Posted by szpt9m View Post
    Hi,

    I am getting an error if I paster this formula in the cell and click on enter!!
    It work fine on my computer

  11. #11
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    Quote Originally Posted by Teethless mama View Post
    It work fine on my computer
    can u attach that sample file which worked in your system.. I may be missing something.. I am not that good at Excel Programming!

  12. #12
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    See the attached file
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    Thanks.. it is working as expected.. but your formula in post #6 contains comma(,) in place of pipe(|).. thats why it didnt work for me!! Thanks again

  14. #14
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    You're Welcome!

  15. #15
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    Oops!!! There is a slight change in the requirement now.. I am really sorry for this but my boss changed it... Can I get average of values instead of sum?

  16. #16
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    Hi All,

    Pls Help me..

    I am able to get sum of values as exepected from the below formula
    Please Login or Register  to view this content.
    can i get average of values instead of SUM?? all other requirements are same.. just need to get average instead of sum!!

  17. #17
    Valued Forum Contributor
    Join Date
    09-15-2011
    Location
    Chennai, India
    MS-Off Ver
    Excel 2010
    Posts
    436

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    I have modified it from 12th post. (For Average)
    Attached Files Attached Files
    Last edited by ramananhrm; 09-17-2013 at 03:26 AM.

  18. #18
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    is it for average or sum?

  19. #19
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    i dont knw why.. i am not able to use any formulas given directly here... it is replacing pipe(|) with comma(,) and giving an error...! if possible pls attach the sample file u r using.. and pls give me a formula to get average and not the sum..

  20. #20
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    Hi Ramananhrm

    Your last excel file works good.. but when i use the same for my excel sheet it doesnt work...

    I have added my values to column A-T of sheet2.. and extended your formula to get average of B5:T5.. but it is not showing anything on A5 of sheet1.. could you pls help me?
    Attached Files Attached Files
    Last edited by szpt9m; 09-17-2013 at 05:31 AM.

  21. #21
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    it is picking only A,C,E.....etc columns.. if I modify it to get B,D,F...etc columns its not working.. ow can i get B,D,F...etc column values..!

  22. #22
    Valued Forum Contributor
    Join Date
    09-15-2011
    Location
    Chennai, India
    MS-Off Ver
    Excel 2010
    Posts
    436

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    Please use this formula for B,D,F.

    =IFERROR(1/(1/(SUMPRODUCT(1-(MOD(COLUMN(Sheet2!A1:G1),2)),Sheet2!A1:G1)/SUMPRODUCT(MOD(COLUMN(Sheet2!A1:G1),2)))),"")

  23. #23
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    wonderful!! worked as expected... Thanks a lot Ramananhrm

  24. #24
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Excel Formula to pull data from another sheet and place cell blank if value is 0

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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] Need a Macro to pull data from one cell and place into another one time
    By jgregory43 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-05-2013, 03:26 PM
  2. [SOLVED] If B2 = 1 then pull data into sheet 2, if B2 is blank skip to next 1
    By djauncey in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-30-2013, 10:22 AM
  3. [SOLVED] Pull data from the same cell across multiple csv files and place into a single excel file
    By rbmrrbmr in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-18-2013, 10:53 AM
  4. Replies: 6
    Last Post: 03-04-2013, 11:25 AM
  5. Is there a formula that will place the sheet name in a cell?
    By Reed in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-19-2005, 10:06 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