Consulting

Results 1 to 15 of 15

Thread: 3 Reference Formulas Not Returning a Result

  1. #1

    3 Reference Formulas Not Returning a Result

    Hi,

    Excel experts. I am stuck.

    I have a formula that is attempting to reference three data points. But I am not getting the resulting I was needing. I want to reference 3 columns with the aggregate formula. For some reason I am not getting the results I need. Here is the formula. The cells that are references are BX2 and BZ2 and CA2. I expect that the data set gives a result of IF(AND) of the BX and CA and BZ columns. Fore example the columns in the rows in the data set that I am referencing doesn't produce the result of these references. It gives me more results than I was looking for.
    I cant attach the workbook for some reason?. But here is the formula. And below are the references.

    =IF(ROWS($A$3:A3)<=$BY$2,IF(AND($BZ$2=INDEX('Accrual & PO Data'!#REF!,AGGREGATE(15,3,('Accrual & PO Data'!#REF!=$BX$2)/('Accrual & PO Data'!#REF!=$BX$2)*ROW('Accrual & PO Data'!$I:$I),ROWS($B$3:B3))),$BX$2=INDEX('Accrual & PO Data'!#REF!,AGGREGATE(15,3,('Accrual & PO Data'!#REF!=$BX$2)/('Accrual & PO Data'!#REF!=$BX$2)*ROW('Accrual & PO Data'!$I:$I),ROWS($B$3:B3)))),INDEX('Accrual & PO Data'!#REF!,AGGREGATE(15,3,('Accrual & PO Data'!#REF!=$BX$2)/('Accrual & PO Data'!#REF!=$BX$2)*ROW('Accrual & PO Data'!$I:$I),ROWS($B$3:B3))),""),"")

    BW2 BX2 BZ2
    Aptiom Grants GR.ADJ 0 093


    Anyy help would be greatly appreciated.

    Thanks,
    Steve

  2. #2
    Any help is appreciated.

  3. #3
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,058
    Location
    Have you tried splitting the formula into parts to test each component?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  4. #4
    VBAX Tutor
    Joined
    Jan 2020
    Posts
    204
    Location
    Quote Originally Posted by Steve Belsch View Post
    Hi,

    Excel experts. I am stuck.

    I have a formula that is attempting to reference three data points. But I am not getting the resulting I was needing. I want to reference 3 columns with the aggregate formula. For some reason I am not getting the results I need. Here is the formula. The cells that are references are BX2 and BZ2 and CA2. I expect that the data set gives a result of IF(AND) of the BX and CA and BZ columns. Fore example the columns in the rows in the data set that I am referencing doesn't produce the result of these references. It gives me more results than I was looking for.
    I cant attach the workbook for some reason?. But here is the formula. And below are the references.

    =IF(ROWS($A$3:A3)<=$BY$2,IF(AND($BZ$2=INDEX('Accrual & PO Data'!#REF!,AGGREGATE(15,3,('Accrual & PO Data'!#REF!=$BX$2)/('Accrual & PO Data'!#REF!=$BX$2)*ROW('Accrual & PO Data'!$I:$I),ROWS($B$3:B3))),$BX$2=INDEX('Accrual & PO Data'!#REF!,AGGREGATE(15,3,('Accrual & PO Data'!#REF!=$BX$2)/('Accrual & PO Data'!#REF!=$BX$2)*ROW('Accrual & PO Data'!$I:$I),ROWS($B$3:B3)))),INDEX('Accrual & PO Data'!#REF!,AGGREGATE(15,3,('Accrual & PO Data'!#REF!=$BX$2)/('Accrual & PO Data'!#REF!=$BX$2)*ROW('Accrual & PO Data'!$I:$I),ROWS($B$3:B3))),""),"")

    BW2 BX2 BZ2
    Aptiom Grants GR.ADJ 0 093


    Anyy help would be greatly appreciated.

    Thanks,
    Steve
    Sorry I can't help but ask, did you notice the #REF!​? Maybe a column or something in the Accrual & PO Data sheet has been removed or moved.

  5. #5
    Yes I have tested the parts of the formula. But maybe I am doing something wrong. How do I attach a document?

    Here is the formula without #ref

    =IF(ROWS($A$3:A3)<=$BY$2,IF(AND($BZ$2=INDEX('Accrual & PO Data'!$J$2:$J$1048576,AGGREGATE(15,3,('Accrual & PO Data'!$J$2:$J$1048576=$BZ$2)/('Accrual & PO Data'!$J$2:$J$1048576=$BZ$2)*ROW('Accrual & PO Data'!$I:$I),ROWS($A$3:B3))),$BX$2=INDEX(LEFT('Accrual & PO Data'!$K$2:$K$1048576,2),AGGREGATE(15,3,(LEFT('Accrual & PO Data'!$K$2:$K$1048576,2)=$BX$2)/(LEFT('Accrual & PO Data'!$K$2:$K$1048576,2)=$BX$2)*ROW('Accrual & PO Data'!$I:$I),ROWS($A$3:B3)))),INDEX('Accrual & PO Data'!A$2:A$1048576,AGGREGATE(15,3,(LEFT('Accrual & PO Data'!$K$2:$K$1048576,2)=$BX$2)/(LEFT('Accrual & PO Data'!$K$2:$K$1048576,2)=$BX$2)*ROW('Accrual & PO Data'!$I:$I),ROWS($A$3:B3))),""),"")

  6. #6
    VBAX Tutor
    Joined
    Jan 2020
    Posts
    204
    Location
    1. a.png
    2. b.jpg

  7. #7
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    or [Advanced] and click the paper clip


    Capture.JPG

    [Add Files] then [Choose File] then [Upload]
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  8. #8

    File is attached

    Any help is appreciated
    Attached Files Attached Files

  9. #9
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,058
    Location
    Bit hard to test when cells referred to contain no data
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  10. #10

    File included

    Here is the data.
    Attached Files Attached Files

  11. #11
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,058
    Location
    You are still making this difficult. If I go to cells BY2 and BZ2 there is no data in them. In trying to dismantle your formula I'm running into issues with the logic as wriiten by you. Can you please explain to us each step in the formula in common english?

    .
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  12. #12
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Did you create this formula? If you did, the complexity suggests that you should know how to solve it yourself. If you didn't, I suggests that you go back to whoever supplied it in the first instance.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  13. #13
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location
    I'd look at the formula in BY2 1st, use helper column(s) to break it up. This seems to be the root but it's ref'd out in your attached workbooks.
    Semper in excretia sumus; solum profundum variat.

  14. #14
    I created this formula. However, for some reason it is returning more results than I wanted. The logic:

    - Reference two cells BX and BY and if they are a match using IF(AND) then return the result from the "Accrual & PO Data" data set
    - I used the aggregate formula because there are multiple instances of the BX and BY data that I expect to be returned. I can't use something simple like VLOOKUP because it won't return multiple results

    Any other ideas would be appreciated. Any other formulas or maybe some VBA coding to make this work.

  15. #15
    The BY formula is just a count if to prevent #NUM error message. But if there is a solution to the main formula then I could figure out how to fix the formula.

    Thank you.

Posting Permissions

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