Excel Function Help Needed, for an IF FALSE "DO NOTHING" POSSIBILITY

JKM00

New Member
Joined
Mar 10, 2023
Messages
22
Office Version
  1. 365
Platform
  1. Windows
Dear All,

I currently have a spreadsheet which is to be used by others to track their monthly and quarterly payments.

On sheet1 I have set up formulas for the user to input their monthly points data, and my formulas use this data to calculate the corresponding funding achievement in Column P for that month. At the top of this sheet, I have set up a simple list so that the user may select the month and year for which the data is relevant.

On sheet2 I aim to pull all of the funding data in column P and insert it into a table with year and month at the top and the different payment categories on the side.
The current code I have used is an IF statement "=IF(AND('Sheet1'!$B$10=Sheet2!C$3, Sheet2!$C$2='Sheet1'!$C$10),'Sheet1'!$P15,0)" where Sheet1 B10 and C10 are the drop down lists for month and year and Sheet2 C2 is the Year and C3-N3 are the months. The code should mean that when the Table headings (Year and Month) for a column in Sheet2 are equal to the selected year and month in Sheet1 then the value is inserted into the cell and if it isn't equal a zero is inputted.

This code works for one month, so if the year and month are set to 'January 2023' in sheet 1 the payment information fills into the table correctly in Sheet2. However, when the month is changed to February 2023 the payment data fills correctly into the February column which is as intended, but the January column changes to all 0s which is unwanted.

I understand that this is what the formula is telling excel to do, but this isn't my intended outcome. I need some kind of formula or code so that when the Year and Month selected in Sheet1 are equal to eg Jan 2023 the values are filled into the Table in Sheet 2 and when it doesn't equal Jan 2023 eg Feb 2023, the values are left as they were when it was equal to Jan 2023.

Is this possible in Excel and could anyone recommend how this can be implemented?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
It sounds like you should change the criteria so that it returns a value for anything less than or equal to the selected date.
 
Upvote 0
I am unsure if this would be sufficient as I strictly want the 2023 January data in the 2023 January column and the 2023 February data in the 2023 February Column. This data is to be entered each month into Sheet 1 and should populate the Table in Sheet 2 automatically depending on the Month and Year selected.

I essentially need a way for a code to work as 'When the Year and Month in the drop-down list in Sheet 1 is equal to the Year and Month of the Column header in the Table in Sheet 2 update the data in the table column BUT WHEN they are not equal to leave whatever is in the cells currently as it is.
 
Upvote 0
I think you'd be better off using actual dates in your data rather than month and year separately. It would then be simple to say if the date is less than the specified date, pull the data back for the relevant month, otherwise return 0.

It would also be easier to help if we could see what we are working with. Can you install the XL2BB forum add-in and post some sample data?
 
Upvote 0
I think you'd be better off using actual dates in your data rather than month and year separately. It would then be simple to say if the date is less than the specified date, pull the data back for the relevant month, otherwise return 0.

It would also be easier to help if we could see what we are working with. Can you install the XL2BB forum add-in and post some sample data?
Tool.xlsx
BCDEFGHIJKLMNOP
9 Month Year
10 January 2023
11Impact and Investment Fund (IIF) 2022/23 - targets and £ estimates
12
13Indicator refBaseline (where req)2022/23 IIF IndicatorsTrend directionTargetsActualsMaximum points£ per pointList size adjustment (estimate)Prevalence adjustment (unknown)Max valuePoints earnedApprox value
14VI-01Percentage of patients aged 65 or over who received a seasonal influenza vaccination between 1 September and 31 March éDenominatorLower thresholdUpper thresholdAchievement0.41579616PCN prev/ Nat prev
151,71480%86%97%40£200.000.42£3,326.3740.00£3,326.37
161,3711,4741,666
17VI-02Percentage of patients aged 18 to 64 years and in a clinical at-risk group who received a seasonal influenza vaccination between 1 September and 31 MarchéDenominatorLower thresholdUpper thresholdAchievement
181,16157%90%86%88£200.000.42£7,318.0177.23£6,422.19
196621,045998
20VI-03Percentage of children aged 2 to 3 who received a seasonal influenza vaccination between 1 September and 31 MarchéDenominatorLower thresholdUpper thresholdAchievement
2123845%82%62%14£200.000.42£1,164.236.50£540.73
22107195148
23HI-01HI-01: Percentage of patients on the Learning Disability register aged 14 or over, who received an annual Learning Disability Health Check and a completed Health Action Plan éDenominatorLower thresholdUpper thresholdAchievement
249260%80%29%36£200.000.42£2,993.730.00£0.00
25557427
26HI-02Percentage of registered patients with a recording of ethnicity on their GP recordéDenominatorLower thresholdUpper thresholdAchievement
2720,30081%95%80%45£200.000.42£3,742.170.00£0.00
2816,44319,28516,192
29CVD-01Percentage of patients aged 18 or over with an elevated blood pressure reading (>=140/90mmHg) and not on the QOF hypertention register for whom there is evidence of clinically appropriate follow-up to confirm or exclude a diagnosis of hypertensionéDenominatorLower thresholdUpper thresholdAchievement
3094725%50%34%71£200.000.42£5,904.3124.37£2,026.29
31237474318
32CVD-02Baseline numberPercentage of registered patients on the QOF hypertenstion register (Threshold is an expected increase)éDenominatorLower thresholdUpper thresholdAchievement
33@1.4.2220,3000.4%0.8%1%35£200.000.42£2,910.5714.14£1,175.70
3424962,5782,6592,610
35CVD-03Percentage of patients aged between 25 and 84 years and with a CVD risk score (QRISK2 or 3) greater than 20% who are currently treated with statinséDenominatorLower thresholdUpper thresholdAchievement
3674548%58%78%31£200.000.42£2,577.9431.00£2,577.94
37358432580
38CVD-04Percentage of patients aged 29 and under with a total cholesterol greater than 7.5 OR aged 30 and over with a total cholesterol greater than 9.0 who have been (i) diagnosed with secondary hyperlipidaemia; or (ii) clinically assessed for familial hypercholesterolaemia; or (iii) referred for assessment for familial hypercholesterolaemia; or (iv) genetically diagnosed with familial hypercholesterolaemiaéDenominatorLower thresholdUpper thresholdAchievement
397320%48%1%18£200.000.42£1,496.870.00£0.00
4015351
2022.23 IIF
Cell Formulas
RangeFormula
I15,I39,I36,I30,I27,I24,I21,I18I15=I16/F15
L14L14=B5/B7
L15,L39,L36,L33,L30,L27,L24,L21,L18L15=$L$14
N15,N39,N36,N33,N30,N27,N24,N21,N18N15=J15*K15*L15
O15,O39,O36,O33,O30,O27,O24,O21,O18O15=IF(I15<G15,0,IF(I15<H15,(J15*((G15-I15)/(G15-H15))),IF(I15>=H15,J15)))
P15,P39,P36,P33,P30,P27,P24,P21,P18P15=IF(M15="",O15*K15*L15,O15*K15*M15*L15)
G16,G40,G37,G31,G28,G25,G22,G19G16=F15*G15
H16,H40,H37,H31,H28,H25,H22,H19H16=F15*H15
F27F27=B5
I28I28=20221-4029
F33F33=B5
I33I33=(I34/F33)-(C34/F33)
G34:H34G34=ROUNDUP($F$33*(($C$34/$F$33)+G33),0)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I27Expression=IF(I28="",TRUE)textNO
I27Expression=IF(I27>=H27,TRUE)textNO
I27Expression=IF(I27>=G27,TRUE)textNO
I27Expression=IF(I27<G27,TRUE)textNO
I15Expression=IF(I16="",TRUE)textNO
I15Expression=IF(I15>=H15,TRUE)textNO
I15Expression=IF(I15>=G15,TRUE)textNO
I15Expression=IF(I15<G15,TRUE)textNO
I18Expression=IF(I19="",TRUE)textNO
I18Expression=IF(I18>=H18,TRUE)textNO
I18Expression=IF(I18>=G18,TRUE)textNO
I18Expression=IF(I18<G18,TRUE)textNO
I21Expression=IF(I22="",TRUE)textNO
I21Expression=IF(I21>=H21,TRUE)textNO
I21Expression=IF(I21>=G21,TRUE)textNO
I21Expression=IF(I21<G21,TRUE)textNO
I24Expression=IF(I25="",TRUE)textNO
I24Expression=IF(I24>=H24,TRUE)textNO
I24Expression=IF(I24>=G24,TRUE)textNO
I24Expression=IF(I24<G24,TRUE)textNO
I30Expression=IF(I31="",TRUE)textNO
I30Expression=IF(I30>=H30,TRUE)textNO
I30Expression=IF(I30>=G30,TRUE)textNO
I30Expression=IF(I30<G30,TRUE)textNO
I33Expression=IF(I34="",TRUE)textNO
I33Expression=IF(I33>=H33,TRUE)textNO
I33Expression=IF(I33>=G33,TRUE)textNO
I33Expression=IF(I33<G33,TRUE)textNO
I36Expression=IF(I37="",TRUE)textNO
I36Expression=IF(I36>=H36,TRUE)textNO
I36Expression=IF(I36>=G36,TRUE)textNO
I36Expression=IF(I36<G36,TRUE)textNO
I39Expression=IF(I40="",TRUE)textNO
I39Expression=IF(I39>=H39,TRUE)textNO
I39Expression=IF(I39>=G39,TRUE)textNO
I39Expression=IF(I39<G39,TRUE)textNO
Cells with Data Validation
CellAllowCriteria
B10List=Sheet4!$C$3:$N$3
C10List=Sheet4!$2:$2
 
Upvote 0
Tool.xlsx
BCDEFGHIJKLMN
22023
3JanuaryFebrauryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember
4VI-01£3,326.37£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
5VI-02£6,422.19£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
6VI-03£540.73£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
7HI-01£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
8HI-02£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
9CVD-01£2,026.29£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
10CVD-02£1,175.70£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
11CVD-03£2,577.94£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
12CVD-04£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
13CVD-05£3,345.38£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
14CVD-06£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
15PC-01£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
16EHCH-01£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
17EHCH-02£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
18EHCH-04£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
19EHCH-06£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
20AC-02£9,230.67£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
21ACC-02£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
22ACC-05£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
23ACC-07£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
24ACC-08£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
25ACC-09£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
26SMR-01A£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
27SMR-01B£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
28SMR-01C£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
29SMR-01D£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
30SMR-02A£332.64£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
31SMR-02B£332.64£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
32SMR-02C£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
33SMR-02D£332.64£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
34SMR-03£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
35RESP-01£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
36RESP-02£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
37ES-01£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
38ES-02£3,659.01£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
39CAN-01£279.18£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00£0.00
Sheet4
Cell Formulas
RangeFormula
C4:N4C4=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P15,0)
C5:N5C5=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P18,0)
C6:N6C6=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P21,0)
C7:N7C7=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P24,0)
C8:N8C8=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P27,0)
C9:N9C9=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P30,0)
C10:N10C10=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P33,0)
C11:N11C11=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P36,0)
C12:N12C12=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P39,0)
C13:N13C13=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P42,0)
C14:N14C14=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P45,0)
C15:N15C15=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P48,0)
C16:N16C16=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P51,0)
C17:N17C17=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P54,0)
C18:N18C18=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P57,0)
C19:N19C19=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),SUM('2022.23 IIF'!$P60,'2022.23 IIF'!$P63),0)
C20:N20C20=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),SUM('2022.23 IIF'!$P66,'2022.23 IIF'!$P69),0)
C21:N21C21=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P72,0)
C22:N22C22=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P75,0)
C23:N23C23=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P78,0)
C24:N24C24=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P81,0)
C25:N25C25=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P84,0)
C26:N26C26=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P87,0)
C27:N27C27=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P90,0)
C28:N28C28=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P93,0)
C29:N29C29=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P96,0)
C30:N30C30=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P99,0)
C31:N31C31=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P102,0)
C32:N32C32=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P105,0)
C33:N33C33=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P108,0)
C34:N34C34=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P111,0)
C35:N35C35=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P114,0)
C36:N36C36=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P117,0)
C37:N37C37=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P120,0)
C38:N38C38=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P123,0)
C39:N39C39=IF(AND('2022.23 IIF'!$B$10=Sheet4!C$3, Sheet4!$C$2='2022.23 IIF'!$C$10),'2022.23 IIF'!$P126,0)
 
Last edited by a moderator:
Upvote 0
The first post is a section of sheet 1 as you can see the month and year selector at the top and I intend the user of this file to change these to input their data which should be stored into the table in sheet2 (2nd post). The payments data is taken from Coumn P in Sheet1.
 
Upvote 0
So the data on the first sheet doesn't adjust when you select a different month/year? (I don't see any dependencies there)
 
Upvote 0
No, the data is inputted into the purple/pink cells by the user, the month/year cells at the top are to ensure the payment data (which is calculated from their inputs into the purple cells) in Column P is stored into the correct column on sheet 2.
 
Upvote 0
I essentially need a formula or code which says when the drop-down list in B10 C10 is equal to e.g April 2023 the data in column F updates with the data in Column P and when B10 C10 doesn't equal April 2023 the data in Column F is left alone as it is.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

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