vba - Excel Dynamically Add To If Row Contains Something -


i have excel sheet used customer data entry, such cost of parts, how paid everything, , how paid (cash, credit, or check). here's first page better look:

sheet1

so on first sheet, enter data need, such name, car make, address (the date dynamic =today()). when type "y" in confirm box, data calculated on sheet2 analyze monetary values. here's sheet 2 data can see i'm talking about:

enter image description here

pressing "new customer" button runs vba script creates new line on sheet1 customer entry, creates corresponding line on sheet2 new line on sheet1 produce calculated data, , "stores" both sheet1 , sheet2 of previous customer data on sheet3.

this leads me question.. sheet2 calculations "cash total", "credit card total", , "check total", need filter through , add (cash + part cost) if paid in cash, (card + part cost) if paid card, , (check + part cost) if paid check. problem cannot figure out how go row row , check whether used cash, card, or credit pay, , add part cost of row corresponding total box. imagine statement such =if(g2 > 0, g2 + e2) or along lines work, cannot figure out , see guys present solutions. please note, (part cost + medium of payment) needs work dynamic range of cells, number of customers day unknown, meaning there different amounts of rows entered "new customer".

from understand try

=sumproduct(--(f2:f7 > 0),d2:d7)+sum(f2:f7) 

the sumproduct adds part cost of rows have cash payment. total added total of cash column. need change f column other payment methods each type.

there isn't way make dynamic. set range large enough never go over.

f2:f1000 

i did not write equation specific sheet. try cash totals.

=sumproduct(--(g2:g1000 > 0),e2:e1000)+sum(g2:g1000) 

you didn't mention multiple payment types. think , you.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -