Conditional Formatting of VLOOKUP, Newbie in need of assistance.

BruceW123

New Member
Joined
Aug 8, 2023
Messages
11
Office Version
  1. 365
Platform
  1. MacOS
Hi all,

New to the forum. I am a treasurer who needs to track who owes money. As money comes in I fill in names in a speadsheet weekly, which calculates whether someone has paid their weekly fee, or owes money.
I have attached a photo of my excel sheet. I have a VLOOKUP with a column which calculates someone's overall debt. What i would, is a way to conditionally format so that said person's name in the weekly column changes colour to red if they fall below 0 in the bottom right corner where the VLOOKUP table is. Can someone help? Thanks in advance.
 

Attachments

  • Screenshot 2023-08-08 at 4.42.01 PM.png
    Screenshot 2023-08-08 at 4.42.01 PM.png
    145.6 KB · Views: 13

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
a countifs may do this for you

something like

countifs($K$11:$K$16, B3, $M$11:$M$16, "<"&0)

Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet. Plus we cannot see any of the formulas used.

Therefore -

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Upvote 0
Book3.xlsx
ABCDEFGHIJKLMN
1WEEK 1WEEK 2WEEK 3
2NamedifferencePaidBalanceNamediffeencePaidBalanceNamedifferencePaidBalance
31Tom040Darryl1040Ben-3010
42****040Harry040Darryl030
53Harry040****-400Harry040
64Darryl-1020Tom040Tom1050
75Ben-400Ben-2020****-2020
8
9
10
11NameChargeBalance
12Tom4010
13****40-60
14Harry400
15Ben40-90
16Darryl300
17
18
19
20
21
22
Sheet3
Cell Formulas
RangeFormula
K3,K5:K7,G4:G7,C7,C3:C4K3=L3-VLOOKUP(J3,'/Users/talia/Library/CloudStorage/GoogleDrive-siamsaleem@gmail.com/My Drive/Pen Drive/[Falcons Weekly Finances.xlsx]Sheet2'!$A$2:$C$100,2,FALSE)
 
Upvote 0
Thank you for your assistance. I have downloaded XL2BB and copy and pasted in my sheet. I am not sure if it has worked in its entirety but i hope it has.
 
Upvote 0
Book3.xlsx
ABCDEFGHIJKLMN
1WEEK 1WEEK 2WEEK 3
2NamedifferencePaidBalanceNamediffeencePaidBalanceNamedifferencePaidBalance
31Tom040Darryl1040Ben-3010
42Nick040Harry040Darryl030
53Harry040Nick400Harry040
64Darryl-1020Tom040Tom1050
75Ben-400Ben-2020Nick-2020
8
9
10
11NameChargeBalance
12Tom4010
13Nick4020
14Harry400
15Ben40-60
16Darryl300
17
18
19
20
21
22
23
Sheet3
Cell Formulas
RangeFormula
M12:M16M12=SUM(IF(B3:J7=K12, C3:K7,0))
 
Upvote 0
I have used =COUNTIFS($K$12:$K$16,B3,$M$12:$M$16,"<"&0) as a conditional formatting rule

for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
Conditional Formatting

Highlight applicable range >>
B3:M7 - Change, reduce or extend the rows to meet your data range of rows

Home Tab >> Styles >> Conditional Formatting
New Rule >> Use a formula to determine which cells to format
Edit the Rule Description: Format values where this formula is true:
=COUNTIFS($K$12:$K$16,B3,$M$12:$M$16,"<"&0)

Format [Number, Font, Border, Fill]
choose the format you would like to apply when the condition is true
OK >> OK

if you also want to highlight the total a simpler conditional format is possible

for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
Conditional Formatting

Highlight applicable range >>
K12:K16 - Change, reduce or extend the rows to meet your data range of rows

Home Tab >> Styles >> Conditional Formatting
New Rule >> Use a formula to determine which cells to format
Edit the Rule Description: Format values where this formula is true:
=M12<0

Format [Number, Font, Border, Fill]
choose the format you would like to apply when the condition is true
OK >> OK

Book1
ABCDEFGHIJKLM
1WEEK 1WEEK 2WEEK 3
2NamedifferencePaidBalanceNamediffeencePaidBalanceNamedifferencePaidBalance
31Tom#N/A40Darryl1040Ben#N/A10
42****#N/A40Harry#N/A40Darryl030
53Harry040****#N/A0Harry#N/A40
64Darryl-1020Tom#N/A40Tom#N/A50
75Ben#N/A0Ben#N/A20****#N/A20
8
9
10
11NameChargeBalance
12Tom4010
13****40-60
14Harry400
15Ben40-90
16Darryl300
Sheet1
Cell Formulas
RangeFormula
K3,K5:K7,G4:G7,C7,C3:C4K3=L3-VLOOKUP(J3,'/Users/talia/Library/CloudStorage/GoogleDrive-siamsaleem@gmail.com/My Drive/Pen Drive/[Falcons Weekly Finances.xlsx]Sheet2'!$A$2:$C$100,2,FALSE)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K12:K16Expression=M12<0textNO
B3:M7Expression=COUNTIFS($K$12:$K$16,B3,$M$12:$M$16,"<"&0)textNO
 
Upvote 0
Solution
Hi,

Thank you so much for that. I have looked for hours but i think i may have ovecomplicated the matter.

I have one more question. Is there a way to put the table from K12:M16 onto another sheet and use it from there. This way i can put all sensitive info like pricing on sheet 2.
 
Upvote 0
yes
but i'm not sure i follow the maths

SUMIFS() will do that for you and you may need to add them together for the different columns

Ben for example shows -90
and has paid 2 lots of 20
when i think 3 lots of 40 due

120 - paid 40 = -80 not -90

anyway i'm not following the maths
and there be better ways to setup up the page ,

or have a running balance
 
Upvote 0
Hi,

I took out the formulas and the maths didnt add up so i inputted them manually. I have corrected it. Can you show me how to add the lookup table to a separate sheet if possible?
 
Upvote 0
Booklet 4.xlsx
ABCDEFGHIJKLM
1NameDIFFPaidBalanceNameDIFFPaidBalanceNameDIFFPaidBalance
21Tom-3010Ben1040Nick1050
32Nick-2020Darryl040Darryl040
43Harry-1030Nick1555Harry-1030
54Darryl040Harry-1030Ben-1020
65Ben1040Tom-1030Tom-3010
7
8
9
10
11NameChargeBalance
12Tom40-70
13Nick405
14Harry40-30
15Darryl400
16Ben3010
17
Sheet1
Cell Formulas
RangeFormula
C2:C6,K2:K6,G2:G6C2=D2-VLOOKUP(B2,$K$12:$M$16, 2,FALSE)
M12:M16M12=SUM(IF($B$2:$J$6=K12,$C$2:$K$6,0))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:M7Expression=COUNTIFS($K$12:$K$20,B2,$M$12:$M$20,"<"&0)textNO
B2:M7Expression=COUNTIFS($K$12:$K$20,B2,$M$12:$M$20,">"&0)textNO
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,310
Members
452,634
Latest member
cpostell

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