+ Reply to Thread
Results 1 to 18 of 18

Help with a complicated IF function

Hybrid View

este994 Help with a complicated IF... 04-20-2011, 05:13 AM
Domski Re: Help with a complicated... 04-20-2011, 05:26 AM
Vinodsralian Re: Help with a complicated... 04-20-2011, 05:35 AM
este994 Re: Help with a complicated... 04-20-2011, 05:36 AM
este994 Re: Help with a complicated... 04-20-2011, 05:38 AM
este994 Re: Help with a complicated... 04-20-2011, 05:40 AM
Domski Re: Help with a complicated... 04-20-2011, 05:47 AM
Marcol Re: Help with a complicated... 04-20-2011, 05:42 AM
este994 Re: Help with a complicated... 04-20-2011, 05:55 AM
Marcol Re: Help with a complicated... 04-20-2011, 06:02 AM
este994 Re: Help with a complicated... 04-20-2011, 06:09 AM
este994 Re: Help with a complicated... 04-20-2011, 06:15 AM
Marcol Re: Help with a complicated... 04-20-2011, 06:21 AM
este994 Re: Help with a complicated... 04-20-2011, 06:31 AM
Marcol Re: Help with a complicated... 04-20-2011, 06:39 AM
este994 Re: Help with a complicated... 04-20-2011, 06:40 AM
este994 Re: Help with a complicated... 04-20-2011, 06:42 AM
Marcol Re: Help with a complicated... 04-20-2011, 07:10 AM
  1. #1
    Registered User
    Join Date
    03-30-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    90

    Help with a complicated IF function

    Hello,

    I wnoder if anyone can help me with the following formula.

    In human language terms I want the formula to do the following:

    If the cell A9 in sheet 1 is the same as the cell I9 in sheet 2, and when the values in column B sheet 1 equal the same as the values in column E sheet 2 then put all the values that have that criteria from column G on sheet 2 onto column R in sheet 1. All of this only when the values in the column G on sheet 2 are bigger than 0.

    Does that make sense?

    Thank you for any help.
    Last edited by este994; 04-20-2011 at 05:21 AM.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Help with a complicated IF function

    That doesn't sound like something you can do with an if statement but I think it would help if you could put together a sample workbook showing your desired outcome.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Contributor
    Join Date
    12-26-2008
    Location
    India
    MS-Off Ver
    2007
    Posts
    122

    Re: Help with a complicated IF function

    Hi,

    This is best of my understanding "=IF(Sheet2!G9 > 0, IF((Sheet1!B9=Sheet2!E9),IF((Sheet1!A9=Sheet2!I9),Sheet2!G9,0),0),0)", if not post sample workbook to fetch the desired output.

    Vinod

  4. #4
    Registered User
    Join Date
    03-30-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    90

    Re: Help with a complicated IF function

    OK thank you.

    Sheet one looks like this:
    COLUMN 1 COLUMN 2 COLUMN 3
    1 A
    2 B
    3 C
    4 D
    5 E
    6 F
    7 G
    8 H
    9 I
    10 J
    11 K
    12 L
    13 M
    14 N
    15 O
    16 P
    17 Q
    18 R
    19 S
    20 T
    21 U
    22 V
    23 W
    24 X
    25 Z
    26 A1
    27 A2
    28 A3
    29 A4
    30 A5
    31 A6
    32 A7
    33 A8
    34 A9
    35 A10
    36 A11
    37 A12
    38 A13

  5. #5
    Registered User
    Join Date
    03-30-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    90

    Re: Help with a complicated IF function

    and I want the result to be in column 3

    sheet 2 looks like this:
    Col 1 Col 2 Col 3 Col 4
    1 A 23
    2 B 24
    3 C 25
    4 D 26
    5 E 27
    1 F 27
    2 G 0
    3 H 0
    45 I 0
    2 J 0
    11 K 34
    12 L 37
    13 M 38
    14 N 59
    15 O 60
    16 P 36
    1 Q 15
    2 R 37
    3 S 59
    4 T 7
    5 U 34
    22 V 56
    23 W 6
    24 X 8
    25 Z 85
    1 A1 3
    2 A2 45
    3 A3 0
    4 A4 0
    5 A5 0
    31 A6 0
    32 A7 7
    33 A8 467
    34 A9 23
    1 A10 412
    36 A11 34
    37 A12 35
    38 A13 568

    If the cell in column 1 in sheet 1 is the same as the value in columne 1 in sheet 2, and when the values in column 2 sheet 1 equal the same as the values in column 2 sheet 2 then put all the values that have that criteria onto column 3 in sheet 1. All of this only when the values in the column 3 on sheet 2 are bigger than 0.

    Does that help? I dont think I know how to upload a spreadsheet?

  6. #6
    Registered User
    Join Date
    03-30-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    90

    Re: Help with a complicated IF function

    Oh! Managed to uplaod it. does tha help?
    Attached Files Attached Files

  7. #7
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Help with a complicated IF function

    Quote Originally Posted by este994 View Post
    Oh! Managed to uplaod it. does tha help?
    Honestly, no. I still haven't got the first clue what you're trying to achieve.

    How does the sample that you uploaded relate to this?

    If the cell A9 in sheet 1 is the same as the cell I9 in sheet 2, and when the values in column B sheet 1 equal the same as the values in column E sheet 2 then put all the values that have that criteria from column G on sheet 2 onto column R in sheet 1. All of this only when the values in the column G on sheet 2 are bigger than 0.
    Dom

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Help with a complicated IF function

    This is just a guess.
    In R9
    =IF(AND(A9=Sheet2!I9,B9=Sheet2!E9),IF(Sheet2!G9>0,Sheet2!G9,""),"")

    If you are talking about comparing ALL the values in Column B "Sheet 1" to Column E "Sheet 2", then I agree with Dom.

    You would do best to post a sample workbook showing your sheet layout, some data, and the expected result..

    It should clearly illustrate your problem and not contain any sensitive data.

    [EDIT]
    Post late, Intended to have have been just after Domskis' Post #2
    Last edited by Marcol; 04-20-2011 at 05:49 AM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  9. #9
    Registered User
    Join Date
    03-30-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    90

    Re: Help with a complicated IF function

    Right, lets try it with this upload. Is that clearer? I have added a column for "Preffered result".
    Attached Files Attached Files

  10. #10
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Help with a complicated IF function

    Is this what you are meaning?
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    03-30-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    90

    Re: Help with a complicated IF function

    Unfortunately the cells come up with 0. Let me have another look at this. I think I might have confused myself ;S

  12. #12
    Registered User
    Join Date
    03-30-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    90

    Re: Help with a complicated IF function

    Right I know what the problem is, however I dont know how to solve it.

    Basically, I pull that formula downwards and the first maybe 100 cells do not have product 1 on sheet two. Therefore, what I need to formula to do is WHEN the first condition (so product name coincide with product name) then simply take the values from the cell with sales on sheet 2. Forget about the greater than 0 thing.

    The problem I am having is that I am dragging the formula down, the columns automaticaal go down and when I get down to the column where product 1 is on sheet 1 and on sheet two then excel is already much further down so it doesnt find it.

    So basically everytime the product name changes I need it to start looking from the top of the spreadsheet so that the product names can coincide.

    Oh god i hope i make sense! Thanks guys for your time... ant ideas?

  13. #13
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Help with a complicated IF function

    Try this workbook based on your last sample

    In D2 this is an array formula
    =IF(ISNUMBER(MATCH(A2&B2,Sheet2!A:A&Sheet2!B:B,0)),INDEX(Sheet2!D:D,MATCH(A2&B2,Sheet2!A:A&Sheet2!B:B,0),1),0)
    Confirm with Ctrl+Shift+Enter, NOT just Enter
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    03-30-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    90

    Re: Help with a complicated IF function

    Still comes up with 0

  15. #15
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Help with a complicated IF function

    Have you looked at the example I posted?
    Did you confirm the formula with Ctrl+Shift+Enter?

    Type or paste the formula in the formula bar
    Then hold down the keys Ctrl and Shift then press enter.
    The formula will then be enclosed in braces {curly brackets}
    Now drag the formula down.

    What Columns are you trying to apply the formula to in your real workbook?

  16. #16
    Registered User
    Join Date
    03-30-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    90

    Re: Help with a complicated IF function

    I think what I am trying to do is too complicated to explain and too complicated to put up in a mock up spreadsheet. There are so many conditions to this, I dont really know where to start.

  17. #17
    Registered User
    Join Date
    03-30-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    90

    Re: Help with a complicated IF function

    If i put up a list of conditions, would that help? I am sure the forumla that you gave me is correct, and I also pressed Ctrl, Shift Enter. But there are more conditions that keep creeping up, which is why is doesnt work.

  18. #18
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Help with a complicated IF function

    Mockup a more realistic workbook that shows the conditions to be met, and the expected results.
    Make sure that the mockup layout is identical to your real sheets layout.

    If you post that we might get somewhere.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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