# Help with SUMIF formula

1. ## Help with SUMIF formula

I have a SUMIF-formula which I need some help with. The formula is SUMIF(T7:T128);"=1") but I would like to add a statement that if a cell in column T (for example T99) and that cell has an "1" in it but is preceded by a cell, on the same row, with an "1" in it in the previous column (in this case cell S99 the "1" in cell T99 should not be counted. How do I write that formula (hope my questions makes sense).

Kind regards,

Hans

2. ## Re: Help with SUMIF formula

Hello and welcome to the forum. If I read your question correctly, this formula should do it:
=SUMIF(T7:T128,"=1")-SUMIFS(S7:S128,S7:S128,"=1",T7:T128,"=1")
It's worth thinking about if you want sumif or countif - what happens if a 2 is in column T?

3. ## Re: Help with SUMIF formula

Hi maclearyj

Many thanks for your suggestion. Will try it out to see if it works. Regarding your question, it can only be a "1".

4. ## Re: Help with SUMIF formula

To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

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.

5. ## Re: Help with SUMIF formula

It worked perfectly! Many thanks for your help.

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### 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