# Thread: Condense this formula using vlookup or hlookup?

1. ## Condense this formula using vlookup or hlookup?

Hi There,

I have this formula here and I would like to know if I can condense it using vlookup, hlookup or any other option.

=IF(cday=1,SUM('NA Input'!C21),IF(cday=2,SUM('NA Input'!C21 21),IF(cday=3,SUM('NA Input'!C21:E21),IF(cday=4,SUM('NA Input'!C21:F21),IF(cday=5,SUM('NA Input'!C21:G21),IF(cday=6,SUM('NA Input'!C21:H21),IF(cday=7,SUM('NA Input'!C21:I21),IF(cday=8,SUM(C21:J21),IF(cday=9,SUM(C21:K21),IF(cday=10,SUM(C21:L21),IF(cday=11,SUM(C21:M21),IF(cday=12,SUM(C21:N21),IF(cday=13,SUM(C21:O21),IF(cday=13,SUM(C21:O21),IF(cday=14,SUM(C21:P21),IF(cday=15,SUM(C21:Q21),IF(cday=16,SUM(C21:R21),IF(cday=17,SUM(C21:S21),IF(cday=18,SUM(C21:T21),IF(cday=19,SUM(C21:U21),IF(cday=20,SUM(C21:V21),IF(cday=21,SUM(C21:W21), IF(cday=22,SUM(C21:X21), IF(cday=23,SUM(C21:Y21), IF(cday=24,SUM(C21:Z21),IF(cday=25,SUM(C21:AA21), IF(cday=26,SUM(C21:AB21), IF(cday=27,SUM(C21:AC21),IF(cday=28,SUM(C21:AD21), IF(cday=29,SUM(C21:AE21), IF(cday=30,SUM(C21:AF21), IF(cday=31,SUM(C21:AG21),0))))))))))))))))))))))))))))))))

The formula is looking up the particular day of the month then add up the right numbers up to the specific day of the month.

Ronnie  Reply With Quote

2. Use PivotTable with Running Total.
Options Slicers, GetPivotData()
Share file if stuck.  Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•