+ Reply to Thread
Results 1 to 10 of 10

Formula to sum values of variables based on similarity

  1. #1
    Forum Contributor
    Join Date
    07-08-2022
    Location
    Baghdad
    MS-Off Ver
    365
    Posts
    145

    Formula to sum values of variables based on similarity

    I need the formula to sum the values of variables based on similarity. The attached file explains the question.
    thx. in advance
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Formula to sum values of variables based on similarity

    You can use this formula in cell K10:

    =SUMIF($A$10:$A$15,J10,$B$10:$B$15)+SUMIF($E$10:$E$15,J10,$F$10:$F$15)

    then copy down.

    Hope this helps.

    Pete

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula to sum values of variables based on similarity

    K10=SUMIF($A$10:$A$15,$J10,$B$10:$B$15)+SUMIF($E$10:$E$15,$J10,$F$10:$F$15) and drag down.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Forum Contributor
    Join Date
    07-08-2022
    Location
    Baghdad
    MS-Off Ver
    365
    Posts
    145

    Re: Formula to sum values of variables based on similarity

    Thx. for your reply
    I forgot to explain that, the sequence of variables (A,B, C,D, E and F) is not fixed in both ranges. I need the formula which able to search on variable A, for example, in both ranges, and if they match, do the sum operation of A values.

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula to sum values of variables based on similarity

    That is what the offered formula does.

    What is the problem you have with the offered solution.

  6. #6
    Forum Contributor
    Join Date
    07-08-2022
    Location
    Baghdad
    MS-Off Ver
    365
    Posts
    145

    Re: Formula to sum values of variables based on similarity

    but How do I search on a variable in a range and put one of two values in the cell that belongs to this variable? like in the attached file
    Attached Files Attached Files
    Last edited by ahmadjumaa80; 07-17-2022 at 03:17 PM.

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Formula to sum values of variables based on similarity

    Both formulae that you were given look for the value from cell J10 to see if it exists in column A and adds the corresponding value from column B for any row where there is a match. It also does this looking down column E and adds any values from column F where column E matches J10.

    As the formula is copied down, J10 becomes J11, then J12 and so on, so your "search variable" is whatever is in column J on any particular row.

    Hope this helps.

    Pete

    EDIT: Ah, you have now attached a new file - give me a few minutes to review that one.

    Pete

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Formula to sum values of variables based on similarity

    I'm sorry, this new file bears no resemblance to the first file, and gives no details of what you want to happen to the B and D data.

    Pete

  9. #9
    Forum Contributor
    Join Date
    07-08-2022
    Location
    Baghdad
    MS-Off Ver
    365
    Posts
    145

    Re: Formula to sum values of variables based on similarity

    sorry for disruption

    I Have two ranges, K5:L8, Range 2, O5:Q8. I need to distribute the values of Both ranges on the Rang 3, B6:B15 based on the value od C (Q4) such that if the value of Q4 is 1, the name has the value 50 otherwis it takes its value from L5:L8
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula to sum values of variables based on similarity

    This is a totaly differant question.

    Based on your data.

    C6=IF(Q5=1,50,$L5) and drag down.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 02-28-2020, 06:10 AM
  2. I need help highlighting cells using a Text Similarity Calculation Formula
    By profiwriteraz in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-27-2015, 06:42 AM
  3. [SOLVED] Comparing Similarity in Text Values VBA
    By MikeRoot in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-31-2014, 11:10 AM
  4. Calculating values based on variables
    By thomasham in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-02-2014, 02:37 PM
  5. Summing values based on variables
    By giejack in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 08-10-2012, 01:02 PM
  6. Cluster Analysis based on Word Similarity
    By roar in forum Excel General
    Replies: 1
    Last Post: 02-07-2012, 10:43 AM
  7. Excel 2007 : Return all values based on 2 variables
    By Aggie81 in forum Excel General
    Replies: 3
    Last Post: 07-26-2010, 11:34 PM

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