Last value in a row with diff. 25% on rel val
Solved/Closed
mattkatt
rizvisa1
- Posts
- 2
- Registration date
- Friday March 5, 2010
- Status
- Member
- Last seen
- March 5, 2010
rizvisa1
- Posts
- 4479
- Registration date
- Thursday January 28, 2010
- Status
- Contributor
- Last seen
- May 5, 2022
Related:
- Last value in a row with diff. 25% on rel val
- Paste data below the last used row - Guide
- Canoscan lide 25 driver windows 10 - Download
- Which of the following is the ack pin in db-25 connector? - Articles
- Excel create unique id for each row ✓ - Forum - Excel
- Print the following pattern for the given n number of rows. pattern for n = 4 1 11 111 1111 ✓ - Forum - Programming
2 replies
rizvisa1
Mar 5, 2010 at 02:40 PM
- Posts
- 4479
- Registration date
- Thursday January 28, 2010
- Status
- Contributor
- Last seen
- May 5, 2022
Mar 5, 2010 at 02:40 PM
How 20 is 50% change from 15
10 * 1.5 = 15
15 * 1.5 = 22.5
10 * 1.5 = 15
15 * 1.5 = 22.5
mattkatt
Mar 5, 2010 at 02:51 PM
- Posts
- 2
- Registration date
- Friday March 5, 2010
- Status
- Member
- Last seen
- March 5, 2010
Mar 5, 2010 at 02:51 PM
yes, that would be 22.5, small mistake when setting the example
rizvisa1
Mar 5, 2010 at 03:47 PM
- Posts
- 4479
- Registration date
- Thursday January 28, 2010
- Status
- Contributor
- Last seen
- May 5, 2022
Mar 5, 2010 at 03:47 PM
Assumption
1. Data is on row 1
2. There is no blank cell between data
3. It will return zero also, if that is the case as 1.5 of 0 is 0
Call the function as =lastFifty()
1. Data is on row 1
2. There is no blank cell between data
3. It will return zero also, if that is the case as 1.5 of 0 is 0
Call the function as =lastFifty()
Public Function lastFifty() As Variant Dim objNum As Object 'hold number and its 1.5 times value Dim vNum As Variant 'current number Dim lastValue As Variant 'last 50 found Dim col As Integer ' start column Set objNum = CreateObject("Scripting.Dictionary") col = 1 lastValue = "" vNum = Trim(Cells(1, col)) Do While (vNum <> "") If Not (objNum.exists(CStr(vNum * 1.5))) Then objNum.Add CStr(vNum * 1.5), vNum End If If (objNum.exists(CStr(vNum))) Then lastValue = vNum End If col = col + 1 vNum = Trim(Cells(1, col)) Loop lastFifty = lastValue End Function