hey guys'
need help writing this formula as a macro, i need to nest an infinite number of
packs
=IF(B1="2pack",H1/4,IF(B1="3 packl",H1/15,IF(B1="4 pack",H1/15,"not")))
thanks
jason
hey guys'
need help writing this formula as a macro, i need to nest an infinite number of
packs
=IF(B1="2pack",H1/4,IF(B1="3 packl",H1/15,IF(B1="4 pack",H1/15,"not")))
thanks
jason
Hi
Why don't you create a table with all your packs and division factors, and
then use Vlookup to retrieve same?
"jwfakouri" wrote:
>
> hey guys'
> need help writing this formula as a macro, i need to nest an
> infinite number of
> packs
> =IF(B1="2pack",H1/4,IF(B1="3
> packl",H1/15,IF(B1="4 pack",H1/15,"not")))
>
> thanks
> jason
>
>
> --
> jwfakouri
> ------------------------------------------------------------------------
> jwfakouri's Profile: http://www.excelforum.com/member.php...o&userid=31435
> View this thread: http://www.excelforum.com/showthread...hreadid=514024
>
>
jason,
Maybe something like this...
'----------------------------------
Function WhackAMole() As Double
Dim strName As String
Dim dblValue As Double
Dim dblAnswer As Double
strName = Range("B1").Text
dblValue = Range("H1").Value2
Select Case strName
Case "2pack"
dblAnswer = dblValue / 4
Case "3pack"
dblAnswer = dblValue / 15
Case "4pack"
dblAnswer = dblValue / 15
'enter as many more as you need...
Case Else
dblAnswer = 0
End Select
WhackAMole = dblAnswer
End Function
'------------------------------------
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
"jwfakouri" wrote in message
hey guys'
need help writing this formula as a macro, i need to nest an
infinite number of
packs
=IF(B1="2pack",H1/4,IF(B1="3
packl",H1/15,IF(B1="4 pack",H1/15,"not")))
thanks
jason
jwfakouri
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks