+ Reply to Thread
Results 1 to 13 of 13

Comparing Range of Cells to another Range of Cells, NO MATH

  1. #1
    Registered User
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2011? Latest Version
    Posts
    7

    Comparing Range of Cells to another Range of Cells, NO MATH

    Hi,

    I have an issue with my excel. I want to compare the contents of the range of cells to another range. Meaning say if my excel was for cooking and ingredients, I have the total of all the ingredients I have in one range. I have the required ingredients for whatever item i want to cook in other ranges. I want to have a cell in which compared the stuff I have to the stuff I need to cook an item and to tell me if I have enough to make it or not.

    I've tried Ifs counts matchs et. and nothing seems to give the results I expect. My most recent formula was:
    =IF(ROWS(F4:Q4)<= ROWS($F$12:$Q$12),"Bake","NO")
    Last edited by AmmiExcel; 10-03-2014 at 11:00 AM.

  2. #2
    Registered User
    Join Date
    08-06-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    80

    Re: Comparing Range of Cells to another Range of Cells, NO MATH

    Hi
    In the list of stuff you have you could put a lookup column (This could be anywhere) then you an ISERROR on the offset cells for example
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Then using this use a look up for TRUE
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Let me know if you'd like any more help. It's obviously not the prettiest way of doing it but it's the most straight forward one I can think of.

    Cheers

  3. #3
    Registered User
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2011? Latest Version
    Posts
    7

    Re: Comparing Range of Cells to another Range of Cells, NO MATH

    Hi,

    Thank you for your reply. I tried out the method that you said and it did not work for me. I don't know how to better explain what I want to do but here is an attempt:

    Sugar Flour Butter Salt eggs can I bake?
    Items I have: 2 cups 1 cup 5 tbsp 1 tspn 6
    To bake Item 1: 2 cups 1 cup 3 tbsp .5 tspn 2 YES
    To bake Item 2: 3 cups 3 cups 4 tbsp 1 tspn 6 NO



    Does that make better sense? my problem is finding a correct formula that compares the ranges from the entire cells with out adding them up and just tells me if the cell in the items I have is equal to or greater than the corresponding to bake cell, all summarized into one. Like there are 5 conditions to actually be able to bake here.

  4. #4
    Registered User
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2011? Latest Version
    Posts
    7

    Re: Comparing Range of Cells to another Range of Cells, NO MATH

    I ended up figuring it out. I just ended up using the IF(AND(f3<=g3, remaining comparisons,....), "Bake", "NO"). It ended up being really long but it worked.

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Comparing Range of Cells to another Range of Cells, NO MATH

    You can use SUMPRODUCT like this

    =IF(SUMPRODUCT((F4:Q4>$F$12:$Q$12)+0),"NO","Bake")
    Audere est facere

  6. #6
    Registered User
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2011? Latest Version
    Posts
    7

    Re: Comparing Range of Cells to another Range of Cells, NO MATH

    See the thing is I dont want to bake all the items. I just want to selectively see if I can bake one over another.

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Comparing Range of Cells to another Range of Cells, NO MATH

    OK, I'm not sure what you mean - I thought you wanted to compare the cells in one range with another - that's what my formula does, if any of the required amounts aren't large enough you get "NO", otherwise "Bake", isn't that what you needed?

  8. #8
    Registered User
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2011? Latest Version
    Posts
    7

    Re: Comparing Range of Cells to another Range of Cells, NO MATH

    Ok, so what I'm trying to do is basically make an easy baking chart for my daughter. I want to have a list of all the things I could bake and their ingredients with an area that she can input what she has and see what item she can bake in another column

    Choices:|Sugar| Flour| Butter |Salt |eggs |can I bake? |
    Items I have:| 2 cups |1 cup |5 tbsp| 1 tspn |6|
    To bake Item 1:| 2 cups | 1 cup |3 tbsp | .5 tspn |2 |YES |
    To bake Item 2: | 3 cups | 3 cups |4 tbsp | 1 tspn |6 |NO |

    I don't want to add up all the choices together and see if I can make it all; I just want to see what item I can make individually. Also, I tried out your equation and while to seemed to have worked for the ones that I could not bake, it did not give me the correct value for a trial that was able to have been baked.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Comparing Range of Cells to another Range of Cells, NO MATH

    Any chance of a small (clean) sample of what you are working with (workbook), and what your expected outcome would look like.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  10. #10
    Registered User
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2011? Latest Version
    Posts
    7

    Re: Comparing Range of Cells to another Range of Cells, NO MATH

    Erm...How would I share that since its a file on my computer, not posted anywhere else? I included basic examples in my previous posts to the best of my ability with the given tools.

  11. #11
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Comparing Range of Cells to another Range of Cells, NO MATH

    I used this formula (In H3 and H4) entered as an ARRAY

    =IF(AND((TRIM(LEFT(B3:F3,FIND(" ",B3:F3&" ")))+0)<= (TRIM(LEFT($B$2:$F$2,FIND(" ",$B$2:$F$2&" ")))+0)),"Yes","No")
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    See attachment
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  12. #12
    Registered User
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2011? Latest Version
    Posts
    7

    Re: Comparing Range of Cells to another Range of Cells, NO MATH

    Oh ok thank you!

  13. #13
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Comparing Range of Cells to another Range of Cells, NO MATH

    1st, often with a copy/paste here, the data presented doesnt come out as you expected.

    2nd, To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

+ 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: 4
    Last Post: 08-04-2014, 04:48 AM
  2. If Then statement comparing value in one cell vs. the values in a range of cells
    By Excel_Tony in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-07-2014, 08:21 AM
  3. VBA code for comparing a range of cells
    By Zimmerman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-01-2010, 04:35 PM
  4. Looping through rows in range AND comparing range cells
    By Damask in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-16-2006, 10:30 PM
  5. applying math operation across range of cells
    By yb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-20-2006, 02:10 AM

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