Hi Amit,
It will fulfil your requirement . J , See the attached.
Function GetTotal(rngLookUpRange, rngMapping As Range, rngLookup As Range,
lngCOlumnresult As Long, lngMinusValue As Double) As Double
Dim VarMapping
Dim VarLookup
Dim strLookUp
Dim lngResult As Double
Dim lngCounter As Long
Dim StrLookupValue As String
VarMapping = rngMapping
VarLookup = rngLookup
StrLookupValue = rngLookUpRange.Value
strLookUp = ""
For lngCounter = LBound(VarMapping) To UBound(VarMapping)
If VarMapping(lngCounter, 1) = StrLookupValue Then
strLookUp = strLookUp & VarMapping(lngCounter, 2) & "|"
End If
Next lngCounter
For lngCounter = LBound(VarLookup) To UBound(VarLookup)
If InStr(strLookUp, VarLookup(lngCounter, 1)) Then
lngResult = lngResult + VarLookup(lngCounter, lngCOlumnresult) -
lngMinusValue
End If
Next lngCounter
GetTotal = lngResult
End Function
Revert if it is not desired
Regards
Rajan verma
+91 7838100659 [IM-Gtalk]
From: [email protected] [mailto:[email protected]]
On Behalf Of Amit Gandhi
Sent: 22 June 2012 5:20
To: [email protected]
Subject: $$Excel-Macros$$ VLOOKUP OR SUMPRODUCT FORMULA HELP
Hi Experts
I have two Input/Lookup tables, and 1 result table. I want a formula which
can give me desired result instantly. Sample file is attached for your ready
reference.
How it will be possible? Pls help me here.
Regards
Amit
--
-- FORUM RULES (986+ members already BANNED for violation) 1) Use concise,
accurate thread titles. Poor thread titles, like Please Help, Urgent, Need
Help, Formula Problem, Code Problem, and Need Advice will not get quick
attention or may not be answered. 2) Don't post a question in the thread of
another member. 3) Don't post questions regarding breaking or bypassing any
security measure. 4) Acknowledge the responses you receive, good or bad. 5)
Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. NOTE : Don't ever post personal or confidential
data in a workbook. Forum owners and members are not responsible for any
loss.
----------------------------------------------------------------------------
-------------------------- To post to this group, send email to
[email protected] To unsubscribe, send a blank email to
[email protected]
--
--
FORUM RULES (986+ members already BANNED for violation)
1) Use concise, accurate thread titles. Poor thread titles, like Please Help,
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited.
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
------------------------------------------------------------------------------------------------------
To post to this group, send email to [email protected]
To unsubscribe, send a blank email to [email protected]
Copy of task.xlsm
Description: application/vnd.ms-excel.sheet.macroenabled.12
