+ Reply to Thread
Results 1 to 5 of 5

Multiple Variables in an IF statement

  1. #1
    Registered User
    Join Date
    05-14-2010
    Location
    Arizona
    MS-Off Ver
    Excel 2007
    Posts
    27

    Question Multiple Variables in an IF statement

    Hey everyone, I need some help on an IF function.

    I'm going to use BAD pseudo-code to describe what I need...

    IF E2 on wkst 1 = 3000 THEN match C2 from Wkst 1 to the corresponding value in cells F121:F236 on Wkst 2

    THEN place value located (matched) from F121:F236 on Wkst 2 in F2 on Wkst 1

    Of course the even tougher part is having to then match L121:236 and M121:M236 at the same time from Wkst 2 to Wkst 1

    e.g. Wkst 1 Wkst 2

    C2 D2 E2 F121 L121 M121
    ABI 607 3000 ABI 300-511310-5002 300-131310-0000

    Required Result:
    Wkst 1
    C2 D2 E2 F2 G2 H2
    ABI 607 3000 ABI 300-511310-5002 300-131310-0000


    To make it worse, I have to do this for accountants. So they need to see a completely automated script (or formula) to guarantee accuracy.
    Attached Files Attached Files
    Last edited by doctork11; 05-14-2010 at 05:57 PM.
    Sincerely,
    Derek

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Multiple Variables in an IF statement

    Hi,

    Can you upload a sample workbook, with a before and after situation so that we can see your request in context. It appears that you may need a VLOOKUP or a combination of =INDEX() and =MATCH(), but sight of a workbook will help establish the solution.

    Regards
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    05-14-2010
    Location
    Arizona
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Multiple Variables in an IF statement

    Thank you Richard...

    I have uploaded the spreadsheet.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Multiple Variables in an IF statement

    Not sure I really understand - based on the sample the majority of combinations are not to be found.

    Sheet1!F2:
    =IF(COUNTIFS(Sheet2!$F$5:$F$468,$C2,Sheet2!$K$5:$K$468,$E2),$C2,"")

    Sheet1!G2:
    =IF($F2="","",LOOKUP(2,1/((Sheet2!$F$5:$F$468=$C2)*(Sheet2!$K$5:$K$468=$E2)),Sheet2!$L$5:$L$468))

    Sheet1!H2
    =IF($F2="","",LOOKUP(2,1/((Sheet2!$F$5:$F$468=$C2)*(Sheet2!$K$5:$K$468=$E2)),Sheet2!$O$5:$O$468))

    (above assumes combination of Service Code and Revenue Site to be unique)

  5. #5
    Registered User
    Join Date
    05-14-2010
    Location
    Arizona
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Multiple Variables in an IF statement

    This worked like a charm. Thank you for the help!

+ 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