ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If Statement Question (https://www.excelbanter.com/excel-worksheet-functions/33707-if-statement-question.html)

redwings04

If Statement Question
 

Hi

I was wondering if it were possible to do the following;

I have a cell picking up a total but I need it to subtract amounts
from a possible 5 other cells. The problem is that the cells may or may
not need to be subtracted. There is a list box to the left of the dollar
amounts that need to be subtracted and I only need to subtact them if
the same list box item is choosen.
For example I have total cash in Cell H5 now i need to subtract amounts
from F21-F24 but only if the listbox next to them has Cash selected.

Any Help Would Be Appreciated.

thank you

Redwings04


--
redwings04
------------------------------------------------------------------------
redwings04's Profile: http://www.excelforum.com/member.php...o&userid=24897
View this thread: http://www.excelforum.com/showthread...hreadid=384328


Anne Troy

Need more information, such as where is the listbox (which I assume is a
data validation dropdown and not a listbox), and what do you want if the
listbox does NOT = cash?
*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com



"redwings04" wrote
in message ...

Hi

I was wondering if it were possible to do the following;

I have a cell picking up a total but I need it to subtract amounts
from a possible 5 other cells. The problem is that the cells may or may
not need to be subtracted. There is a list box to the left of the dollar
amounts that need to be subtracted and I only need to subtact them if
the same list box item is choosen.
For example I have total cash in Cell H5 now i need to subtract amounts
from F21-F24 but only if the listbox next to them has Cash selected.

Any Help Would Be Appreciated.

thank you

Redwings04


--
redwings04
------------------------------------------------------------------------
redwings04's Profile:

http://www.excelforum.com/member.php...o&userid=24897
View this thread: http://www.excelforum.com/showthread...hreadid=384328




redwings04


Thanks for the response.
You are right it is just a data valadation drop box, and if it doesn't
= cash i want it not to subtract it.


Thanks


--
redwings04
------------------------------------------------------------------------
redwings04's Profile: http://www.excelforum.com/member.php...o&userid=24897
View this thread: http://www.excelforum.com/showthread...hreadid=384328


Matt Lunn

This is how I'd do it. Make sure that the adjacent cell to column F were
linked cells to the listboxes (post back if you're not sure how to do this).
So E21 is the linked cell to the first listbox, E22 the second listbox etc.

in I5 enter the following

=SUM((E21:E24="Cash")*(F21:F24))

and press Ctrl + Shift + Enter

This will give you the amount you need to subtract from H5

HTH
Matt

"redwings04" wrote:


Hi

I was wondering if it were possible to do the following;

I have a cell picking up a total but I need it to subtract amounts
from a possible 5 other cells. The problem is that the cells may or may
not need to be subtracted. There is a list box to the left of the dollar
amounts that need to be subtracted and I only need to subtact them if
the same list box item is choosen.
For example I have total cash in Cell H5 now i need to subtract amounts
from F21-F24 but only if the listbox next to them has Cash selected.

Any Help Would Be Appreciated.

thank you

Redwings04


--
redwings04
------------------------------------------------------------------------
redwings04's Profile: http://www.excelforum.com/member.php...o&userid=24897
View this thread: http://www.excelforum.com/showthread...hreadid=384328



Ragdyer

Say the present formula in H5 is:
=SUM(A1:A10)

Picking Column G as the one containing the dropdown, try this in H5:

=SUM(A1:A10)-SUMIF(G21:G24,"Cash",F21:F24)
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"Anne Troy" wrote in message
news:4b065$42c9601e$97c5108d$423@allthenewsgroups. com...
Need more information, such as where is the listbox (which I assume is a
data validation dropdown and not a listbox), and what do you want if the
listbox does NOT = cash?
*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com



"redwings04"

wrote
in message ...

Hi

I was wondering if it were possible to do the following;

I have a cell picking up a total but I need it to subtract amounts
from a possible 5 other cells. The problem is that the cells may or may
not need to be subtracted. There is a list box to the left of the dollar
amounts that need to be subtracted and I only need to subtact them if
the same list box item is choosen.
For example I have total cash in Cell H5 now i need to subtract amounts
from F21-F24 but only if the listbox next to them has Cash selected.

Any Help Would Be Appreciated.

thank you

Redwings04


--
redwings04
------------------------------------------------------------------------
redwings04's Profile:

http://www.excelforum.com/member.php...o&userid=24897
View this thread:

http://www.excelforum.com/showthread...hreadid=384328






All times are GMT +1. The time now is 01:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com