SumProduct to hard for me :(

freakyOne

New Member
Joined
Feb 13, 2018
Messages
2
i tried this

Code:
With Worksheets("Hilfstabelle")
    Worksheets("Linienauswertung").Range("G14").Value = Application.WorksheetFunction.SumProduct((.Range("D2:D" & Zeilenzahl)) * (.Range("A2:A" & Zeilenzahl) Mod 10), "<9")
    End With

what i want is, sum the values in Column D for each row, where the value in column A does NOT have a 9 at 4th sign (it has only 4 numbers, like 1119, 1190, 3543, 7769...)

i tried it with modulo and sumproduct but failed :(

First try was this

Worksheets("Linienauswertung").Range("B" & i + 14).Value = Application.SumIfs(.Range("D2:D" & Zeilenzahl), .Range("C2:C" & Zeilenzahl), "FS", Right(.Range("A2:A" & Zeilenzahl), 1), "<>9")
is there an easier way to tell him skip if there is a 9 at the end of the Value?

Greetings and thanks
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I think I'd be inclined to do this as a two-step process:

Code:
With Worksheets("Linienauswertung").Range("G14")
    .FormulaArray = "=SUM(IF(MOD(Hilfstabelle!A2:A" & Zeilenzahl & ",10)<9,Hilfstabelle!D2:D" & Zeilenzahl & "))"
    .Value = .Value
End With

WBD
 
Upvote 0

Forum statistics

Threads
1,214,936
Messages
6,122,340
Members
449,079
Latest member
rocketslinger

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top