Consulting

Results 1 to 8 of 8

Thread: Probably So Easy It's Embarassing!

  1. #1

    Probably So Easy It's Embarassing!

    Hello! I feel like a dummy asking this as it is probably the most simple thing ever but I have a major headache trying to work it out!!
    Here is what I am trying to tell Excel to do...

    If the # in worksheet CHECKBOOK!N:N is a "2"
    And the Text in CHECKBOOK!C:C matches "TMOBILE"
    Paste whatever number is in CHECKBOOK!E:E
    Into Worksheet Cell BILLS!B25

    I have no idea how I keep getting this screwed up...
    Any help is so greatly appreciated!!!
    Jennifer

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    PHP Code:
    =INDEX(CheckBook!E1:E1000,SUMPRODUCT(--(CheckBook!C1:C1000="TMOBILE"),--(CheckBook!N1:N1000=2),ROW(A1:A1000))) 
    Last edited by Aussiebear; 04-24-2023 at 01:00 AM. Reason: Added code tags
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Regular
    Joined
    Nov 2008
    Posts
    44
    Location
    In your example, you use N:N, C:C, etc. And you want the answer to go into cell B25. I don't understand how you can get "one answer" using this notation. How will the formula know which row you are interested in?


    Duluter

  4. #4
    why not create another column (eg column o)and combine "tmobile" and "2" and use that column to be "looked up" against

    step 1 = formula in column 0 =CONCATENATE(C3&N3) etc
    step 2 = in cell b26 (or any "spare" cell in sheet "bills") simply type the text TMOBILE2
    step3 = in cell B25 in bills use a sumif ie =SUMIF(Checkbook!O:O,bills!B26,Checkbook!E:E)

    I tried it and it works...

  5. #5
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Thanks Immatoity,, I missed that column E was a number. That simplifies SumProduct.

    PHP Code:
    =SUMPRODUCT(--(Checkbook!C1:C10000="TMOBILE"),--(Checkbook!N1:N10000=2),(Checkbook!E1:E10000)) 
    Jennifer, these answers depend on unique solutions in your data. There is no check for that.
    Last edited by Aussiebear; 04-24-2023 at 01:01 AM. Reason: Added code tags
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  6. #6
    Quote Originally Posted by mdmackillop
    Thanks Immatoity,, I missed that column E was a number. That simplifies SumProduct.

    PHP Code:
    =SUMPRODUCT(--(Checkbook!C1:C10000="TMOBILE"),--(Checkbook!N1:N10000=2),(Checkbook!E1:E10000)) 
    Jennifer, these answers depend on unique solutions in your data. There is no check for that.
    not used sumproduct before... cheers mdmackillop..will have a play later
    Last edited by Aussiebear; 04-24-2023 at 01:01 AM. Reason: Added code tags

  7. #7
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Read all about it here.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  8. #8
    Hello! I tried the above solutions and they all worked great!!
    Thanks so much for the help everyone!!!

    Jennifer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •