Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Excel Functions

Excel Functions

Scheduled Pinned Locked Moved The Lounge
question
15 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J JacquesDP

    Here it is, if this is too much of programming, just say and I will delete it. I have a table, to columns, one is client id and the other payments. There can be multiple of the same client id, so lets say on a different sheet I want to just enter the client id, it then must lookup the Id and sum all the payments, now I'm looking for the function to do that.

    He who laughs last is a bit on the slow side

    R Offline
    R Offline
    Roger Stoltz
    wrote on last edited by
    #5

    This means that you have to find out what client IDs exists in the first sheet by searching it since you cannot know this otherwise, right? I'm not aware of any built-in function or macro that can accomplish what you ask for. I would write a VBA macro that searches the first sheet for client IDs and place them into a map that maps the ID with a sum. When the search is completed I'd write the results to the other sheet. A word of caution: we're closing up on programming questions in the Lounge. ;)


    "It's supposed to be hard, otherwise anybody could do it!" - selfquote
    "High speed never compensates for wrong direction!" - unknown

    J 1 Reply Last reply
    0
    • L Lost User

      HLOOKUP and VLOOKUP functions exist, just use the in-built help file for these functions

      R Offline
      R Offline
      Roger Stoltz
      wrote on last edited by
      #6

      If I'm not mistaking, HLOOKUP and VLOOKUP cannot be used in this situation since... - they require something to search for which we don't have - they require a range which we dont know about - they would only return one value and we have to iterate over multiple rows


      "It's supposed to be hard, otherwise anybody could do it!" - selfquote
      "High speed never compensates for wrong direction!" - unknown

      L 1 Reply Last reply
      0
      • R Roger Stoltz

        If I'm not mistaking, HLOOKUP and VLOOKUP cannot be used in this situation since... - they require something to search for which we don't have - they require a range which we dont know about - they would only return one value and we have to iterate over multiple rows


        "It's supposed to be hard, otherwise anybody could do it!" - selfquote
        "High speed never compensates for wrong direction!" - unknown

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #7

        Think I misread his question

        R 1 Reply Last reply
        0
        • L Lost User

          Think I misread his question

          R Offline
          R Offline
          Roger Stoltz
          wrote on last edited by
          #8

          Richard A. Abbott wrote:

          Think I misread his question

          Quite allright. :) Happens to myself from time to time as well.


          "It's supposed to be hard, otherwise anybody could do it!" - selfquote
          "High speed never compensates for wrong direction!" - unknown

          1 Reply Last reply
          0
          • J JacquesDP

            Here it is, if this is too much of programming, just say and I will delete it. I have a table, to columns, one is client id and the other payments. There can be multiple of the same client id, so lets say on a different sheet I want to just enter the client id, it then must lookup the Id and sum all the payments, now I'm looking for the function to do that.

            He who laughs last is a bit on the slow side

            P Offline
            P Offline
            Pixa
            wrote on last edited by
            #9

            Once you have the IDs you could use COUNTIF. If the client IDs are sequential then you could have a table of 1 to the current highest client ID and then add a few more rows for good luck and use either a formula or conditional formatting to hide the cell's value if the COUNT of a particular ClientID is 0 Otherwise it's VBA Macro time (have fun)...

            J 1 Reply Last reply
            0
            • R Roger Stoltz

              This means that you have to find out what client IDs exists in the first sheet by searching it since you cannot know this otherwise, right? I'm not aware of any built-in function or macro that can accomplish what you ask for. I would write a VBA macro that searches the first sheet for client IDs and place them into a map that maps the ID with a sum. When the search is completed I'd write the results to the other sheet. A word of caution: we're closing up on programming questions in the Lounge. ;)


              "It's supposed to be hard, otherwise anybody could do it!" - selfquote
              "High speed never compensates for wrong direction!" - unknown

              J Offline
              J Offline
              JacquesDP
              wrote on last edited by
              #10

              Roger Stoltz wrote:

              we're closing up on programming questions in the Lounge. ;)

              I know, that's what I was afraid of. Thank for the help, no to learn how to write a macro. :doh:

              He who laughs last is a bit on the slow side

              1 Reply Last reply
              0
              • P Pixa

                Once you have the IDs you could use COUNTIF. If the client IDs are sequential then you could have a table of 1 to the current highest client ID and then add a few more rows for good luck and use either a formula or conditional formatting to hide the cell's value if the COUNT of a particular ClientID is 0 Otherwise it's VBA Macro time (have fun)...

                J Offline
                J Offline
                JacquesDP
                wrote on last edited by
                #11

                Thanks,

                Pixa wrote:

                (have fun).

                Will try :)

                He who laughs last is a bit on the slow side

                1 Reply Last reply
                0
                • L Lost User

                  HLOOKUP and VLOOKUP functions exist, just use the in-built help file for these functions

                  J Offline
                  J Offline
                  JacquesDP
                  wrote on last edited by
                  #12

                  Do you know by any chance if you could do something like : SUM(B2:B200) Where A1=x

                  He who laughs last is a bit on the slow side

                  1 Reply Last reply
                  0
                  • J JacquesDP

                    Here it is, if this is too much of programming, just say and I will delete it. I have a table, to columns, one is client id and the other payments. There can be multiple of the same client id, so lets say on a different sheet I want to just enter the client id, it then must lookup the Id and sum all the payments, now I'm looking for the function to do that.

                    He who laughs last is a bit on the slow side

                    B Offline
                    B Offline
                    Bassam Abdul Baki
                    wrote on last edited by
                    #13

                    Try SumIf.


                    "Patriotism is the last refuge of a scoundrel." - Samuel Johnson Web - Blog - RSS - Math - LinkedIn - BM

                    J 1 Reply Last reply
                    0
                    • B Bassam Abdul Baki

                      Try SumIf.


                      "Patriotism is the last refuge of a scoundrel." - Samuel Johnson Web - Blog - RSS - Math - LinkedIn - BM

                      J Offline
                      J Offline
                      JacquesDP
                      wrote on last edited by
                      #14

                      Thanks, exactly what I wanted to do. Works 100

                      He who laughs last is a bit on the slow side

                      B 1 Reply Last reply
                      0
                      • J JacquesDP

                        Thanks, exactly what I wanted to do. Works 100

                        He who laughs last is a bit on the slow side

                        B Offline
                        B Offline
                        Bassam Abdul Baki
                        wrote on last edited by
                        #15

                        NeroToxic wrote:

                        Works 100

                        If 100% = 1, then 100 = 10,000%. You've broken the laws of reality. ;-P


                        "Patriotism is the last refuge of a scoundrel." - Samuel Johnson Web - Blog - RSS - Math - LinkedIn - BM

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups