+ Reply to Thread
Results 1 to 19 of 19

Vlookup??

  1. #1
    Registered User
    Join Date
    09-25-2007
    Posts
    38

    Vlookup??

    I have been trying to work out another formula to search cells of a column, and when a cell matches the a value it adds the corresponding cell to achieve one total. I am not sure if I need to do a VLOOKUP or not??

    So if there is the value Local in column E and it is in e24 the corresponding cell j24 is added to one total, in the end any cells in column j correspnding with cells with the value Local in column E will all be added together. If there is a different value Long then they will be added together - I hope this makes sense!

    The formula that I have so far is =IF(E24=Local,SUM(J24:J89),0) but it only works because I have to correct range of cells selected. I want the range of cells to be expanded to include anything in that columnn. I tried =IF(E24=Local,SUM(J1:1000),0) but that just added every thing in column J.

    I dont think it was a very good attempt.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Hi ricoandquesa,

    I think what you're looking for is a SUMIF function, for example:

    =SUMIF(E:E,"local",J:J)

    This will search column E for all instances of "local" and sum the values in column J only where "local" is found.

  3. #3
    Registered User
    Join Date
    09-25-2007
    Posts
    38
    Heya - I think I was trying to get too complicated - would the same formula if I subsituted SUMIF with COUNTIF?
    Thanks Quesa

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Hi again,

    So are you trying to just count the number of times 'Local' appears in column E? Or are you wanting to sum column J as well?
    Last edited by Paul; 10-24-2007 at 11:17 PM.

  5. #5
    Registered User
    Join Date
    09-25-2007
    Posts
    38
    Hi Paul

    How could I adjust the formula to find local and locals and add them together?

    Thank you Quesa

  6. #6
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    Quote Originally Posted by ricoandquesa
    Hi Paul

    How could I adjust the formula to find local and locals and add them together?

    Thank you Quesa
    To SUM

    =SUMIF(E:E,"local",J:J)+SUMIF(E:E,"locals",J:J)

  7. #7
    Registered User
    Join Date
    09-25-2007
    Posts
    38
    Quote Originally Posted by pjoaquin
    Hi again,

    So are you trying to just count the number of times 'Local' appears in column E? Or are you wanting to sum column J as well?

    Heya

    I was trying to both - one to coun the times local appeared and the other one to sum column J.

    I think I worked it out how to do the count - =COUNTIF(E:E,"Local")
    That gives me all the "local" in column E!

    What do you think?

  8. #8
    Registered User
    Join Date
    09-25-2007
    Posts
    38
    Quote Originally Posted by starguy
    To SUM

    =SUMIF(E:E,"local",J:J)+SUMIF(E:E,"locals",J:J)
    Hi there,

    Thanks for that - I had worked out one formula as well -

    =SUMIF(E:E,"local",J:J)+SUM(SUMIF(E:E,"locals",J:J))

    but I think after seeing yours mine is unessarily long + pointless!

    Thanks for the help

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Or just

    =SUM(E:E = {"local","locals"}, J:J)

  10. #10
    Registered User
    Join Date
    09-25-2007
    Posts
    38
    Quote Originally Posted by shg
    Or just

    =SUM(E:E = {"local","locals"}, J:J)
    Even better - thanks

  11. #11
    Registered User
    Join Date
    09-25-2007
    Posts
    38
    Nah sorry that didn't work that just added up everything in that column - I want to only add up corresponding cell that has local and locals

  12. #12
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    Quote Originally Posted by ricoandquesa
    Nah sorry that didn't work that just added up everything in that column - I want to only add up corresponding cell that has local and locals
    Please attach sample file in zip format.

  13. #13
    Registered User
    Join Date
    10-25-2007
    Posts
    35
    Quote Originally Posted by shg
    Or just

    =SUM(E:E = {"local","locals"}, J:J)
    I think you mean

    =SUMIF(E:E = {"local","locals"}, J:J)

  14. #14
    Registered User
    Join Date
    09-25-2007
    Posts
    38
    Quote Originally Posted by owainl
    I think you mean

    =SUMIF(E:E = {"local","locals"}, J:J)
    I tried this as well it didn't work

    Currently I have the formula
    =SUMIF('6'!E:E,"local",'6'!J:J)+SUMIF('6'!E:E,"locals",'6'!J:J)
    the answer that i got is 5.40

    I just tried
    =SUMIF('6'!E:E={"local","locals"},'6'!J:J)
    and that came up as a formula error

    Then I tried
    =SUMIF('6'!E:E,{"Call to 13 Number","Calls to 13 Numbers"},'6'!J:J)
    the answer was 3.00 and that is wrong

    Any ideas....

  15. #15
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Seeing as we're 14 posts, wait, now 15, into this thread, I think it's going to be necessary for you to upload a copy of your sheet, or an example of it, and note what results you're expecting.

    I'm still not even sure if you're trying to sum or count cells, to be honest.

    To upload an excel workbook you must first zip it, then when replying click the paperclip icon, browse for your zip file, upload it and then close the attachment window.

    To zip the file you can use a zipping utility such as WinZip, or if you have Windows XP you can simply right-click on the file and choose Send To -> Compressed Folder. That will create a zip file in the same folder as your excel file.

  16. #16
    Registered User
    Join Date
    09-25-2007
    Posts
    38
    Hey there,

    I have shaded the cells that we are working on. The formula that is there now works fine. I need to have both count and sum. There where some other suggestions that the formula could be shortened but they didn't work very well.

    Thanks Quesa
    Attached Files Attached Files

  17. #17
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    I think I know what you're asking for.. to shorten the SUMIF and COUNTIF formulas?

    If so, these seemed to work:
    Please Login or Register  to view this content.
    and
    Please Login or Register  to view this content.
    Since '13 Number' is the same between both instances, this works. I suppose you could use just *13* instead, but that might pick up any other instance where 13 is anywhere in the cell (if that even exists?)

  18. #18
    Registered User
    Join Date
    09-25-2007
    Posts
    38
    Hey Paul,

    Thanks for that at least the formula is a little shorter and it works great.

    Thanks for all your help Quesa

  19. #19
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    You're welcome, I'm glad to assist when I can.

+ 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