+ Reply to Thread
Results 1 to 6 of 6

how to use a variable for the criteria in a sumif function?

  1. #1
    Dick B.
    Guest

    how to use a variable for the criteria in a sumif function?

    I am trying to use a named variable for the criteria in a sumif function.
    =sumif(A1:A4,"currentjobno",B1:B4)
    currentjobno has a value of 38006

  2. #2
    Elkar
    Guest

    RE: how to use a variable for the criteria in a sumif function?

    Remove the quotes.

    =sumif(A1:A4,currentjobno,B1:B4)

    HTH,
    Elkar


    "**** B." wrote:

    > I am trying to use a named variable for the criteria in a sumif function.
    > =sumif(A1:A4,"currentjobno",B1:B4)
    > currentjobno has a value of 38006


  3. #3
    Ian P
    Guest

    RE: how to use a variable for the criteria in a sumif function?

    I didn't think it was possible to define a variable in "just" Excel. I
    thought this had to be do in VB. If I've got it wrong then how do you define
    variables in Excel?

    Thanks

    Ian

    "Elkar" wrote:

    > Remove the quotes.
    >
    > =sumif(A1:A4,currentjobno,B1:B4)
    >
    > HTH,
    > Elkar
    >
    >
    > "**** B." wrote:
    >
    > > I am trying to use a named variable for the criteria in a sumif function.
    > > =sumif(A1:A4,"currentjobno",B1:B4)
    > > currentjobno has a value of 38006


  4. #4
    Elkar
    Guest

    RE: how to use a variable for the criteria in a sumif function?

    I'm assuming he's referring to a single cell as a named range, rather than a
    variable. Although the effect is very similar.

    "Ian P" wrote:

    > I didn't think it was possible to define a variable in "just" Excel. I
    > thought this had to be do in VB. If I've got it wrong then how do you define
    > variables in Excel?
    >
    > Thanks
    >
    > Ian
    >
    > "Elkar" wrote:
    >
    > > Remove the quotes.
    > >
    > > =sumif(A1:A4,currentjobno,B1:B4)
    > >
    > > HTH,
    > > Elkar
    > >
    > >
    > > "**** B." wrote:
    > >
    > > > I am trying to use a named variable for the criteria in a sumif function.
    > > > =sumif(A1:A4,"currentjobno",B1:B4)
    > > > currentjobno has a value of 38006


  5. #5
    Ian P
    Guest

    RE: how to use a variable for the criteria in a sumif function?

    Thanks, for a moment I thought a whole new area of Excel was going to open
    up, much the same as when I first found out that it was possible to use VB in
    worksheets.

    Ian

    "Elkar" wrote:

    > I'm assuming he's referring to a single cell as a named range, rather than a
    > variable. Although the effect is very similar.
    >
    > "Ian P" wrote:
    >
    > > I didn't think it was possible to define a variable in "just" Excel. I
    > > thought this had to be do in VB. If I've got it wrong then how do you define
    > > variables in Excel?
    > >
    > > Thanks
    > >
    > > Ian
    > >
    > > "Elkar" wrote:
    > >
    > > > Remove the quotes.
    > > >
    > > > =sumif(A1:A4,currentjobno,B1:B4)
    > > >
    > > > HTH,
    > > > Elkar
    > > >
    > > >
    > > > "**** B." wrote:
    > > >
    > > > > I am trying to use a named variable for the criteria in a sumif function.
    > > > > =sumif(A1:A4,"currentjobno",B1:B4)
    > > > > currentjobno has a value of 38006


  6. #6
    Dick B.
    Guest

    RE: how to use a variable for the criteria in a sumif function?

    Thanks, Yes I have a single cell as a named range. It works great.
    Thanks


    "Ian P" wrote:

    > Thanks, for a moment I thought a whole new area of Excel was going to open
    > up, much the same as when I first found out that it was possible to use VB in
    > worksheets.
    >
    > Ian
    >
    > "Elkar" wrote:
    >
    > > I'm assuming he's referring to a single cell as a named range, rather than a
    > > variable. Although the effect is very similar.
    > >
    > > "Ian P" wrote:
    > >
    > > > I didn't think it was possible to define a variable in "just" Excel. I
    > > > thought this had to be do in VB. If I've got it wrong then how do you define
    > > > variables in Excel?
    > > >
    > > > Thanks
    > > >
    > > > Ian
    > > >
    > > > "Elkar" wrote:
    > > >
    > > > > Remove the quotes.
    > > > >
    > > > > =sumif(A1:A4,currentjobno,B1:B4)
    > > > >
    > > > > HTH,
    > > > > Elkar
    > > > >
    > > > >
    > > > > "**** B." wrote:
    > > > >
    > > > > > I am trying to use a named variable for the criteria in a sumif function.
    > > > > > =sumif(A1:A4,"currentjobno",B1:B4)
    > > > > > currentjobno has a value of 38006


+ 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