We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
Any Google Sheets wizards that can help?
Options

firsttimebuyer2013
Posts: 159 Forumite
Basically, I'm trying to get a sheet to do a sum, depending on what the drop down menu says.

The drop down menu will have about 4 options. The first one, if 'Cost' is selected, has to be C2-B2 witht the result in D2.
The second, with 'Profit', or two other choices under the dropdown (for example bonus, gift), just need to be whatever the value of C3 is to appear in D3.
Is this possible at all?
Thank you

The drop down menu will have about 4 options. The first one, if 'Cost' is selected, has to be C2-B2 witht the result in D2.
The second, with 'Profit', or two other choices under the dropdown (for example bonus, gift), just need to be whatever the value of C3 is to appear in D3.
Is this possible at all?

Thank you
0
Comments
-
Simplest way is to use the IF function
http://spreadsheets.about.com/od/otherspreadsheets/qt/090808-google-spreadsheet-if-function.htm0 -
I had a look at that sheet but I'm still none the wiser. Can anyone help?0
-
firsttimebuyer2013, the above link, look at row 5 in the example instead of "Yes", replace with "Cost", then do your sums
looks like you will need the OR function too to
A gift is a loss, so it is -1*C3 to appear in D3 ???0 -
I'm not going to second guess what the correct calculations should be.
If I've read the OP right then the calculation is that if the dropdown says 'Cost' it should be one calculation, and if it says anything else it should be another. In which case
[STRIKE]Otherwise, if there's a third calculation, 'nest' it where the final 'C2' bit is.[/STRIKE]
Edit: apparantly you can't nest IF statements on google sheets. That will make things interesting0 -
I'm not going to second guess what the correct calculations should be.
If I've read the OP right then the calculation is that if the dropdown says 'Cost' it should be one calculation, and if it says anything else it should be another. In which case
[STRIKE]Otherwise, if there's a third calculation, 'nest' it where the final 'C2' bit is.[/STRIKE]
Edit: apparantly you can't nest IF statements on google sheets. That will make things interesting=if(A2="Cost",C2-B2, IF(A2="Gift",B2/-1, IF(A2="Profit",C2, IF(A2="Bonus","send money to bluesnake"))))
0 -
You can nest IF, but looks weird at first. D2 becomes
=if(A2="Cost",C2-B2, IF(A2="Gift",B2/-1, IF(A2="Profit",C2, IF(A2="Bonus","send money to bluesnake"))))
The way this formula works is it first looks at A2 and decides if it contains 'Cost'. If it does, it sets the cell to C2-B2 and stops. If it doesn't, it looks at the second IF statement.
It then looks to see if A2 contains 'Gift'. If it does, it sets the value to the negative flip of C2 and stops. If it doesn't, it sets the value to C2 and as there are no more nests the formula finishes.0 -
Ah yes, I found when I was in the nest clicking cells didn't copy them into the formula, so I assumed it wasn't possible. Just tried manually entering the nested formula and it works fine.
The way this formula works is it first looks at A2 and decides if it contains 'Cost'. If it does, it sets the cell to C2-B2 and stops. If it doesn't, it looks at the second IF statement.
It then looks to see if A2 contains 'Gift'. If it does, it sets the value to the negative flip of C2 and stops. If it doesn't, it sets the value to C2 and as there are no more nests the formula finishes.
Thank you so much. Actually got it to work. Really appreciate that. :beer:0
This discussion has been closed.
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 350.8K Banking & Borrowing
- 253.1K Reduce Debt & Boost Income
- 453.5K Spending & Discounts
- 243.8K Work, Benefits & Business
- 598.7K Mortgages, Homes & Bills
- 176.8K Life & Family
- 257.1K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.6K Read-Only Boards