+ Reply to Thread
Results 1 to 24 of 24

Calculate value from one row based on the text value of another row

  1. #1
    Registered User
    Join Date
    01-31-2019
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    58

    Calculate value from one row based on the text value of another row

    Row A of products, Product A, Product B.....Product F, over 100 rows.
    Row B has cost of the products in Row A. Product A has three different prices throughout the row and same with other products.

    What I want to do:
    ROW D auto calculate
    Product A
    Product B
    Product C
    ...
    Product F

    Row E auto calculate
    Total cost of Product A
    Total cost of Product B
    and so on...

    In the future if I add Product G, I want that to show up in ROW D and Total of it in Row E.

    Can anyone help?

    Capture.JPG

    Thank you.
    Last edited by Na-Dude; 01-31-2019 at 10:02 PM.

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,369

    Re: Calculate value from one row based on the text value of another row

    For Products, put this on column D and copied down:
    =IFERROR(INDEX($A$3:$A$500,MATCH(0,INDEX(COUNTIF($D$2:D2,$A$3:$A$500&""),0,0),0)),"")

    For Totals, put this on column E and copied down
    =SUMIFS($B$3:$B$500,$A$3:$A$500,$D3)
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-31-2019
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    58

    Re: Calculate value from one row based on the text value of another row

    Thank you for you help. AMAZING and super fast reply.

    I am having a problem. I have row a and b merged. it didn't work when two rows are merged. When I un-merged the rows, product a and b show up. next row is blank, nothing shows up after that. when i enter something in the black row everything appears.

    Quote Originally Posted by azumi View Post
    For Products, put this on column D and copied down:
    =IFERROR(INDEX($A$3:$A$500,MATCH(0,INDEX(COUNTIF($D$2:D2,$A$3:$A$500&""),0,0),0)),"")

    For Totals, put this on column E and copied down
    =SUMIFS($B$3:$B$500,$A$3:$A$500,$D3)
    1.JPG

    2.JPG
    Last edited by Na-Dude; 01-31-2019 at 10:58 PM.

  4. #4
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,369

    Re: Calculate value from one row based on the text value of another row

    PLease don't put an image, upload your excel file to the forum, click on "Go Advanced" button, then scoll down to find "Manage Attachments" text button to attach your file


    regards
    Azumi

  5. #5
    Registered User
    Join Date
    01-31-2019
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    58

    Re: Calculate value from one row based on the text value of another row

    Quote Originally Posted by azumi View Post
    PLease don't put an image, upload your excel file to the forum, click on "Go Advanced" button, then scoll down to find "Manage Attachments" text button to attach your file


    regards
    Azumi
    Sorry about that.

    attached is the example file

    also can anything be done if row A and B are merged?

    thanks
    Attached Files Attached Files
    Last edited by Na-Dude; 01-31-2019 at 11:21 PM.

  6. #6
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,369

    Re: Calculate value from one row based on the text value of another row

    Hope his works
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-31-2019
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    58

    Re: Calculate value from one row based on the text value of another row

    Quote Originally Posted by azumi View Post
    hope his works
    worked perfectly.

    Thank you so much...

  8. #8
    Registered User
    Join Date
    01-31-2019
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    58

    Re: Calculate value from one row based on the text value of another row

    Ran into another problem with this.

    If I enter the cost. the same cost goes in all available slots.

    Capture.JPG
    Attached Files Attached Files
    Last edited by Na-Dude; 02-01-2019 at 04:02 PM.

  9. #9
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: Calculate value from one row based on the text value of another row

    One way:

    Modify Azumi's E3 formula from:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    to:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And copy down to E12

  10. #10
    Registered User
    Join Date
    01-31-2019
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    58

    Re: Calculate value from one row based on the text value of another row

    Quote Originally Posted by GeoffW283 View Post
    One way:

    Modify Azumi's E3 formula from:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    to:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And copy down to E12
    Thank you GeoffW and Azumi.

    Its working like a charm for now.

  11. #11
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: Calculate value from one row based on the text value of another row

    Thanks for the feedback. Azumi did all the hard work here

  12. #12
    Registered User
    Join Date
    01-31-2019
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    58
    Quote Originally Posted by GeoffW283 View Post
    Thanks for the feedback. Azumi did all the hard work here
    One more addition to the same string.

    I want to create a new row that shows beside product column, how many line items were there for each product.

    In this case C3 Would show total of D3 (A) how many time Product A appeared in Column A.

    Total product A... So on
    Attached Files Attached Files
    Last edited by Na-Dude; 02-02-2019 at 04:31 AM.

  13. #13
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Calculate value from one row based on the text value of another row

    Don't quote whole posts -- it's just clutter. If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding

    For normal conversational replies, try using the QUICK REPLY box below.

  14. #14
    Registered User
    Join Date
    01-31-2019
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    58

    Re: Calculate value from one row based on the text value of another row

    Will do. Thanks

  15. #15
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Calculate value from one row based on the text value of another row

    Dear Na-Dude : your post 12# file not open. Can you re attach valid file.


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  16. #16
    Registered User
    Join Date
    01-31-2019
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    58

    Re: Calculate value from one row based on the text value of another row

    Sorry, here is the file again.
    Attached Files Attached Files

  17. #17
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Calculate value from one row based on the text value of another row

    In "C3"
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    01-31-2019
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    58
    This will only do product "A"? I want it to count all products? Do I just manually change for the 100 items? That would take a long time. Any work around to auto do for all rows, A to Z...also need to keep in mind there are empty rows to account for.

    Thanks
    Last edited by Na-Dude; 02-02-2019 at 04:56 AM.

  19. #19
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Calculate value from one row based on the text value of another row

    in "C3" copied down.

    Please Login or Register  to view this content.

  20. #20
    Registered User
    Join Date
    01-31-2019
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    58

    Re: Calculate value from one row based on the text value of another row

    I'm getting extra numbers. at the end of the sheet.

    Capture.JPG
    Attached Files Attached Files

  21. #21
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Calculate value from one row based on the text value of another row

    Kindly change range 499 to actual range as 19 in "D" & "E" columns.
    See attachment.
    Attached Files Attached Files

  22. #22
    Registered User
    Join Date
    01-31-2019
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    58

    Re: Calculate value from one row based on the text value of another row

    If i change the rage just to 19 rows than every time a new item is added the foumula would have to be changed. Can we add an if statement to check column D?

  23. #23
    Registered User
    Join Date
    01-31-2019
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    58

    Re: Calculate value from one row based on the text value of another row

    So I used the same advise from GeoffW283 and added =IF(D2="","", in front of the countif statement. Its appeared to have worked.

    =IF(D2="","",COUNTIF($A$2:$A$500,$D2))

    Capture.JPG
    Attached Files Attached Files
    Last edited by Na-Dude; 02-02-2019 at 12:04 PM.

  24. #24
    Registered User
    Join Date
    01-31-2019
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    58

    Re: Calculate value from one row based on the text value of another row

    Once again thank you everyone for the help and advice. I'm sure i'll have more questions....

+ 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. [SOLVED] Calculate Cell based on Name and Text Lookup
    By hayden.decosta in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-13-2018, 03:15 AM
  2. [SOLVED] Formula to calculate based on another cells text?
    By hopegriffin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-22-2016, 03:41 PM
  3. Formula to calculate % based on a number & text in cells
    By Skyboy88 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-15-2014, 07:02 AM
  4. Calculate a weighted average based on text category
    By zbomb2000 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-27-2013, 10:07 PM
  5. [SOLVED] How to calculate average based on text
    By axendra12 in forum Excel General
    Replies: 10
    Last Post: 10-24-2012, 07:13 AM
  6. Calculate Sales Manger based on conditions in Text
    By toxicatom in forum Excel General
    Replies: 5
    Last Post: 03-12-2012, 03:29 PM
  7. Calculate cells based on text
    By sweber25 in forum Excel General
    Replies: 3
    Last Post: 01-11-2009, 05:14 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