+ Reply to Thread
Results 1 to 10 of 10

Formula to calculate in one cell based on word in a different cell

  1. #1
    Registered User
    Join Date
    01-27-2009
    Location
    Owen Sound, Ontario
    MS-Off Ver
    Excel 2016
    Posts
    71

    Formula to calculate in one cell based on word in a different cell

    I used to have a formula that would calculate and amount in on cell based on a word in another cell. For example I am trying to set up a registration form and attendees will be paying based on the days they attend. So if I type the word First Day in cell B4 then C4 would automatically display $40. In this case I have 3 choices and I used to have a formula that would use 3 different columns and have 3 different formulas. So if B4 said First Day C4 would say 40, If B4 said second day then D4 would say 70 and if B$ said Both then E4 would say 110.

    I also had a spreadsheet at 1 time that had 1 formula for all 3 choices. So it would be if B4 equals First Day C4 equals 40, if B$ equals Second Day C4 equals 70, if B4 equals both c4 equals 100

    I can not remember any of these formulas because I have not been using excel as much as I used to for awhile.

    I will attach a small sample of what I mean and if anyone is able to help with either choice I would appreciate any help.

    Thanks so much!
    Attached Files Attached Files
    Last edited by NBVC; 03-23-2010 at 12:36 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula to calculate in one cell based on word in a different cell

    If you have solved this yourself, kindly post your solution in order to benefit future users with similar problem...

    Thanks.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    01-27-2009
    Location
    Owen Sound, Ontario
    MS-Off Ver
    Excel 2016
    Posts
    71

    Re: Formula to calculate in one cell based on word in a different cell

    That was an accident on my part. I do not have this solved. I think I have fixed it now

  4. #4
    Registered User
    Join Date
    01-27-2009
    Location
    Owen Sound, Ontario
    MS-Off Ver
    Excel 2016
    Posts
    71

    Re: Formula to calculate in one cell based on word in a different cell

    I did not mean to post this as solved. Do you know how I fix this or should it be deleted and reposted? I am not sure if I am able to delete my own posts. Are you able to help me with this?

    Thanks and sorry for the confusion

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

    Re: Formula to calculate in one cell based on word in a different cell

    There are a number of ways to do this. Here's one. In C4 dragged down
    =LOOKUP(B4,{"Day 1","Day 2","Day 3"},{40,70,110})
    Does that work for you?
    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

  6. #6
    Registered User
    Join Date
    01-27-2009
    Location
    Owen Sound, Ontario
    MS-Off Ver
    Excel 2016
    Posts
    71

    Re: Formula to calculate in one cell based on word in a different cell

    This works great! The only problem is that until I type in Day 1 or Day 2 or Day 3 there is a #N/A showing in the formula cells. Do you know how I can get rid of that or change to a 0? I can live with it if I need to.

    Thanks a lot!

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

    Re: Formula to calculate in one cell based on word in a different cell

    =IF(B4="","",LOOKUP(B4,{"Day 1","Day 2","Day 3"},{40,70,110})) Does that work?

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula to calculate in one cell based on word in a different cell

    Quote Originally Posted by Squint View Post
    I did not mean to post this as solved. Do you know how I fix this or should it be deleted and reposted? I am not sure if I am able to delete my own posts. Are you able to help me with this?

    Thanks and sorry for the confusion
    I removed the [Solved]

  9. #9
    Registered User
    Join Date
    01-27-2009
    Location
    Owen Sound, Ontario
    MS-Off Ver
    Excel 2016
    Posts
    71

    Re: Formula to calculate in one cell based on word in a different cell

    This one works much better.

    Just wondering if you can help me with 1 more I think simpler formula for
    if cell a4=Lunch then B4 = 12.50?

    Thanks for all your help

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula to calculate in one cell based on word in a different cell

    Is that the same B4 in your previous formula?

    If so, not sure that you will be able to use this formula and the one ChemistB gave you together to get final results.

    If it is not the same B4 as above, then, in B4, =IF(A4="Lunch",12.5,"") formatted to 2 decimals, if desired.

+ 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