+ Reply to Thread
Results 1 to 6 of 6

If Function

  1. #1
    Registered User
    Join Date
    09-18-2004
    Posts
    49

    If Function

    Hi,
    Can somebody please help with this?

    I have a user who is populating a fund name in cell A1 (e.g. LF1) and the currency of that fund in B1 (e.g. GBP).

    Cell C1 needs to extract the account code (from a separate wks) based on the inputs previously.

    On a account information wks there are many different funds, but what complicates things (at least for me) is that a single can have multiple currencies so in our example LF1 might also have account numbers for USD, EUR as well as GBP. How can I find the correct account code and deposit it in C1. I am assuming I can't use nested IF's are there are too many variables.

    Regards
    Simon

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451
    I'm assuming that the data on the other sheet is set up with the Fund Code in Column A, Currency Code in Column B and the Account Code in Column C

    Use the sumproduct function: In C1 type the following
    =SUMPRODUCT(--(sheet2!A1:A1000=A1),--(sheet2!B1:B1000=B1),sheet2!C1:C1000)

  3. #3
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    If your 'Account Code' is made up of alphanumerical characters, try the following...

    =INDEX(AccountCodeRange,MATCH(1,(FundRange=FundName)*(CurrencyRange=Currency),0))

    ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

    Hope this helps!

    Quote Originally Posted by sgrech
    Hi,
    Can somebody please help with this?

    I have a user who is populating a fund name in cell A1 (e.g. LF1) and the currency of that fund in B1 (e.g. GBP).

    Cell C1 needs to extract the account code (from a separate wks) based on the inputs previously.

    On a account information wks there are many different funds, but what complicates things (at least for me) is that a single can have multiple currencies so in our example LF1 might also have account numbers for USD, EUR as well as GBP. How can I find the correct account code and deposit it in C1. I am assuming I can't use nested IF's are there are too many variables.

    Regards
    Simon

  4. #4
    Registered User
    Join Date
    09-18-2004
    Posts
    49
    Quote Originally Posted by Cutter
    I'm assuming that the data on the other sheet is set up with the Fund Code in Column A, Currency Code in Column B and the Account Code in Column C

    Use the sumproduct function: In C1 type the following
    =SUMPRODUCT(--(sheet2!A1:A1000=A1),--(sheet2!B1:B1000=B1),sheet2!C1:C1000)
    Thanks CUTTER that's works treat. IF the account number was in a column say H how would I amend the formula.

    Also I would be most grateful if you explain the code more specifically the "--" bit.

    Thanks
    Simon
    Last edited by sgrech; 02-26-2005 at 06:31 PM.

  5. #5
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    Quote Originally Posted by sgrech
    ...IF the account number was in a column say H how would I amend the formula.
    =SUMPRODUCT(--(sheet2!A1:A1000=A1),--(sheet2!B1:B1000=B1),sheet2!H1:H1000)


    Also I would be most grateful if you explain the code more specifically the "--" bit.
    Have a look at Aladin's contribution here...

    http://www.mrexcel.com/board2/viewtopic.php?t=103530

    Hope this helps!

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451
    You're quite welcome, Simon. Thanks for the feedback.

    I see Domenic has answered your question about Column H.

    For an explanation about the double unary try this site:
    http://www.mcgimpsey.com/excel/formulae/doubleneg.html

+ 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